aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Frank Denis <github@pureftpd.org>2021-11-18 14:05:45 +0100
committerGravatar Frank Denis <github@pureftpd.org>2021-11-18 14:05:45 +0100
commitf278117be2e5ee563813df83e1f22fd567461d4e (patch)
treea6bd3d80697f13896bf765be9b3911df235103fb
parent9abbb95ab6c51b5fb85db7c5ea65843b4d788aae (diff)
downloadtweetpipe-f278117be2e5ee563813df83e1f22fd567461d4e.tar.gz
Honor LDFLAGS, and always add cpp flags
-rw-r--r--Makefile9
1 files changed, 5 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index 7c8fba6..1ec8041 100644
--- a/Makefile
+++ b/Makefile
@@ -1,10 +1,11 @@
PREFIX ?= /usr/local
WFLAGS ?= -Wall -Wextra -Wmissing-prototypes -Wdiv-by-zero -Wbad-function-cast -Wcast-align -Wcast-qual -Wfloat-equal -Wmissing-declarations -Wnested-externs -Wno-unknown-pragmas -Wpointer-arith -Wredundant-decls -Wstrict-prototypes -Wswitch-enum -Wno-type-limits
CFLAGS ?= -O3 -march=native -fno-exceptions -flto $(WFLAGS)
-CFLAGS += -I. -Iext/libhydrogen
-OBJ = ext/libhydrogen/hydrogen.o src/encpipe.o src/safe_rw.o
+CPPFLAGS += -I. -Iext/libhydrogen
STRIP ?= strip
+OBJ = ext/libhydrogen/hydrogen.o src/encpipe.o src/safe_rw.o
+
SRC = \
ext/libhydrogen/hydrogen.c \
src/common.h \
@@ -20,10 +21,10 @@ bin: encpipe
$(OBJ): $(SRC)
.c.o:
- $(CC) $(CFLAGS) -o $@ -c $<
+ $(CC) $(CFLAGS) $(CPPFLAGS) -o $@ -c $<
encpipe: $(OBJ)
- $(CC) $(CFLAGS) -o encpipe $(OBJ)
+ $(CC) $(CFLAGS) -o encpipe $(LDFLAGS) $(OBJ)
ext/libhydrogen/hydrogen.c:
git submodule update --init || echo "** Make sure you cloned the repository **" >&2