1
0

In Makefile use LDFLAGS only for build of an executable, and CFLAGS only for build of the object files.

This commit is contained in:
Alexander Andreev 2024-03-25 00:54:18 +04:00
parent 174f0df1d4
commit 97e5dae4db
Signed by: Arav
GPG Key ID: 25969B23DCB5CA34

View File

@ -16,10 +16,10 @@ CFLAGS = --std=c99 -D_POSIX_C_SOURCE=200112L -O3 -Wall -Werror -Wextra -pedantic
LDFLAGS += -lportaudio -lopus -lsodium LDFLAGS += -lportaudio -lopus -lsodium
$(TARGET): $(OBJs) $(TARGET): $(OBJs)
$(CC) $(CFLAGS) $(LDFLAGS) $^ -o $@ $(CC) $(LDFLAGS) $^ -o $@
$(OBJ_DIR)/%.o: $(SRC_DIR)/%.c | $(OBJ_DIR) $(OBJ_DIR)/%.o: $(SRC_DIR)/%.c | $(OBJ_DIR)
$(CC) $(CFLAGS) $(LDFLAGS) -c $< -o $@ $(CC) $(CFLAGS) -c $< -o $@
$(OBJ_DIR): $(OBJ_DIR):
mkdir -p $@ mkdir -p $@