2024-03-21 04:10:02 +04:00
|
|
|
TARGET = tetatet
|
|
|
|
|
|
|
|
CC = cc
|
|
|
|
|
|
|
|
DESTDIR :=
|
|
|
|
PREFIX := /usr/local
|
|
|
|
|
|
|
|
SRC_DIR := src
|
|
|
|
OBJ_DIR := obj
|
|
|
|
|
|
|
|
SRCs := $(wildcard $(SRC_DIR)/*.c)
|
|
|
|
OBJs := $(SRCs:$(SRC_DIR)/%.c=$(OBJ_DIR)/%.o)
|
|
|
|
|
2024-03-28 04:19:29 +04:00
|
|
|
CFLAGS = --std=c99 -D_POSIX_C_SOURCE=200809L -O3 -Wall -Werror -Wextra -pedantic
|
2024-03-25 01:16:41 +04:00
|
|
|
CFLAGS += -flto
|
2024-03-21 04:10:02 +04:00
|
|
|
LDFLAGS += -lportaudio -lopus -lsodium
|
|
|
|
|
|
|
|
$(TARGET): $(OBJs)
|
2024-03-25 00:54:18 +04:00
|
|
|
$(CC) $(LDFLAGS) $^ -o $@
|
2024-03-21 04:10:02 +04:00
|
|
|
|
|
|
|
$(OBJ_DIR)/%.o: $(SRC_DIR)/%.c | $(OBJ_DIR)
|
2024-03-25 00:54:18 +04:00
|
|
|
$(CC) $(CFLAGS) -c $< -o $@
|
2024-03-21 04:10:02 +04:00
|
|
|
|
|
|
|
$(OBJ_DIR):
|
2024-03-22 04:15:44 +04:00
|
|
|
mkdir -p $@
|
|
|
|
|
2024-04-01 00:03:38 +04:00
|
|
|
install: | $(TARGET)
|
|
|
|
strip tetatet
|
|
|
|
install -m0755 tetatet $(DESTDIR)$(PREFIX)/bin/tetatet
|
|
|
|
|
|
|
|
uninstall:
|
|
|
|
rm -f $(DESTDIR)$(PREFIX)/bin/tetatet
|
|
|
|
|
2024-03-22 04:15:44 +04:00
|
|
|
clean:
|
2024-03-24 19:29:45 +04:00
|
|
|
rm -f ${TARGET}
|
|
|
|
rm -f obj/*.o
|