Mercurial > hg > nnchat
view Makefile.gen @ 671:dd3083a3383d
Use the makefile.inc helper from th-libs for generic targets.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Wed, 09 Mar 2016 15:09:59 +0200 |
parents | 32c13602c091 |
children | 650e7a5c74c5 |
line wrap: on
line source
### ### Main makefile ### CFLAGS += -g -W -Wall -Wextra -DTH_NO_DEFAULTS -I. CFLAGS += -O2 CFLAGS += -std=c11 -pedantic -D_XOPEN_SOURCE=500 THLIBS=th-libs/ # # Version strings # NN_VERSION := $(shell cat VERSION) comma:= , NN_VERSION_COM := $(subst .,$(comma),$(NN_VERSION)) CFLAGS += -DNN_VERSION=\"$(NN_VERSION)\" # # Objects # THLIBS_A=$(OBJPATH)thlibs.a THLIBS_OBJ=th_util.o th_string.o th_args.o th_ioctx.o th_file.o th_config.o th_network.o th_datastruct.o NNCHAT_OBJ=main.o util.o ui.o NNCHAT_BIN=$(BINPATH)nnchat$(EXEEXT) TARGETS += $(NNCHAT_BIN) include $(THLIBS)/Makefile.inc # # Target rules # main.c: VERSION $(NNCHAT_BIN): $(addprefix $(OBJPATH),$(NNCHAT_OBJ)) $(THLIBS_A) $(EXTRAOBJS) @echo " LINK $@" @$(CC) $(CFLAGS) -o $@ $+ $(LDFLAGS) # # Documentation # $(DOC): @wget -qO- http://www.tnsp.org/~ccr/nnchat/ | tr '\n' '§' | \ sed "s/<.-- BEGIN -->.*<.-- END -->//g;s/<script.*<\/script>//g" | tr '§' '\n' > "$@.tmp" @links -dump "$@.tmp" > $@