In Makefile use LDFLAGS only for build of an executable, and CFLAGS only for build of the object files.
This commit is contained in:
parent
174f0df1d4
commit
97e5dae4db
4
Makefile
4
Makefile
@ -16,10 +16,10 @@ CFLAGS = --std=c99 -D_POSIX_C_SOURCE=200112L -O3 -Wall -Werror -Wextra -pedantic
|
||||
LDFLAGS += -lportaudio -lopus -lsodium
|
||||
|
||||
$(TARGET): $(OBJs)
|
||||
$(CC) $(CFLAGS) $(LDFLAGS) $^ -o $@
|
||||
$(CC) $(LDFLAGS) $^ -o $@
|
||||
|
||||
$(OBJ_DIR)/%.o: $(SRC_DIR)/%.c | $(OBJ_DIR)
|
||||
$(CC) $(CFLAGS) $(LDFLAGS) -c $< -o $@
|
||||
$(CC) $(CFLAGS) -c $< -o $@
|
||||
|
||||
$(OBJ_DIR):
|
||||
mkdir -p $@
|
||||
|
Loading…
Reference in New Issue
Block a user