1
0
tetatet/Makefile

36 lines
639 B
Makefile
Raw Normal View History

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)
CFLAGS = --std=c99 -D_POSIX_C_SOURCE=200809L -O3 -Wall -Werror -Wextra -pedantic
CFLAGS += -flto
2024-03-21 04:10:02 +04:00
LDFLAGS += -lportaudio -lopus -lsodium
$(TARGET): $(OBJs)
$(CC) $(LDFLAGS) $^ -o $@
2024-03-21 04:10:02 +04:00
$(OBJ_DIR)/%.o: $(SRC_DIR)/%.c | $(OBJ_DIR)
$(CC) $(CFLAGS) -c $< -o $@
2024-03-21 04:10:02 +04:00
$(OBJ_DIR):
2024-03-22 04:15:44 +04:00
mkdir -p $@
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:
rm -f ${TARGET}
rm -f obj/*.o