29 lines
512 B
Makefile
29 lines
512 B
Makefile
TARGET = tetatet
|
|
|
|
CC = cc
|
|
|
|
DESTDIR :=
|
|
DESTDIR = /
|
|
PREFIX := /usr/local
|
|
|
|
SRC_DIR := src
|
|
OBJ_DIR := obj
|
|
|
|
SRCs := $(wildcard $(SRC_DIR)/*.c)
|
|
OBJs := $(SRCs:$(SRC_DIR)/%.c=$(OBJ_DIR)/%.o)
|
|
|
|
CFLAGS = --std=c99 -D_POSIX_C_SOURCE=200112L -O3 -Wall -Werror -Wextra -pedantic
|
|
LDFLAGS += -lportaudio -lopus -lsodium
|
|
|
|
$(TARGET): $(OBJs)
|
|
$(CC) $(CFLAGS) $(LDFLAGS) $^ -o $@
|
|
|
|
$(OBJ_DIR)/%.o: $(SRC_DIR)/%.c | $(OBJ_DIR)
|
|
$(CC) $(CFLAGS) $(LDFLAGS) -c $< -o $@
|
|
|
|
$(OBJ_DIR):
|
|
mkdir -p $@
|
|
|
|
clean:
|
|
rm -f ${TARGET}
|
|
rm -f obj/*.o
|