mirror of
https://github.com/NikitaIvanovV/ctpv.git
synced 2024-11-24 05:43:08 +01:00
Minor: allow overriding CFLAGS with command line
This commit is contained in:
parent
a4b95979b5
commit
5d96d12b51
14
Makefile
14
Makefile
@ -8,11 +8,10 @@ DEP := $(OBJ:.o=.d)
|
||||
PRE := $(wildcard sh/prev/*)
|
||||
GEN := gen/previews.h gen/server.h gen/helpers.h
|
||||
|
||||
O := -O2
|
||||
LIBS := magic crypto
|
||||
|
||||
CFLAGS += $(O) -MD -Wall -Wextra -Wno-unused-parameter
|
||||
LDFLAGS += $(addprefix -l,$(LIBS))
|
||||
ALL_CFLAGS := -O2 -MD -Wall -Wextra -Wno-unused-parameter $(CFLAGS) $(CPPFLAGS)
|
||||
ALL_LDFLAGS := $(addprefix -l,$(LIBS)) $(CFLAGS) $(LDFLAGS)
|
||||
|
||||
INSTALL := install
|
||||
|
||||
@ -20,8 +19,8 @@ all: ctpv
|
||||
|
||||
options:
|
||||
@echo "CC = $(CC)"
|
||||
@echo "CFLAGS = $(CFLAGS)"
|
||||
@echo "LDFLAGS = $(LDFLAGS)"
|
||||
@echo "CFLAGS = $(ALL_CFLAGS)"
|
||||
@echo "LDFLAGS = $(ALL_LDFLAGS)"
|
||||
|
||||
install: install.bin install.man
|
||||
|
||||
@ -47,7 +46,10 @@ docs: README.md doc/ctpv.1
|
||||
deptable/list.awk $(PRE) | deptable/roff.sed | deptable/insert.awk doc/ctpv.1
|
||||
|
||||
ctpv: $(OBJ)
|
||||
$(CC) -o $@ $+ $(LDFLAGS)
|
||||
$(CC) -o $@ $+ $(ALL_LDFLAGS)
|
||||
|
||||
.c.o:
|
||||
$(CC) -o $@ $< -c $(ALL_CFLAGS)
|
||||
|
||||
# Exclicit rules for generated header files
|
||||
src/ctpv.o: gen/previews.h
|
||||
|
Loading…
Reference in New Issue
Block a user