Mercurial > hg > nnchat
comparison Makefile.gen @ 718:1ab9b538c0bb default tip
Rename Makefile.gen to Makefile.common
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Thu, 03 Aug 2023 19:17:58 +0300 |
parents | 183818be0d83 |
children |
comparison
equal
deleted
inserted
replaced
717:183818be0d83 | 718:1ab9b538c0bb |
---|---|
1 ### | |
2 ### Main makefile | |
3 ### | |
4 CFLAGS += -g -W -Wall -Wextra -I. | |
5 CFLAGS += -O2 | |
6 CFLAGS += -std=c11 -pedantic -D_XOPEN_SOURCE=500 | |
7 THLIBS=th-libs/ | |
8 | |
9 # | |
10 # Version strings | |
11 # | |
12 NN_VERSION := $(shell cat VERSION) | |
13 comma:= , | |
14 NN_VERSION_COM := $(subst .,$(comma),$(NN_VERSION)) | |
15 CFLAGS += -DNN_VERSION=\"$(NN_VERSION)\" | |
16 | |
17 # | |
18 # Objects | |
19 # | |
20 THLIBS_A=$(OBJPATH)thlibs.a | |
21 THLIBS_OBJ=th_util.o th_string.o th_args.o th_file.o th_config.o \ | |
22 th_network.o th_datastruct.o th_ioctx.o th_ioctx_stdio.o | |
23 | |
24 NNCHAT_OBJ=main.o util.o ui.o | |
25 NNCHAT_BIN=$(BINPATH)nnchat$(BINEXT) | |
26 | |
27 TARGETS += $(NNCHAT_BIN) | |
28 | |
29 include $(THLIBS)/Makefile.inc | |
30 | |
31 # | |
32 # Target rules | |
33 # | |
34 main.c: VERSION | |
35 | |
36 $(NNCHAT_BIN): $(addprefix $(OBJPATH),$(NNCHAT_OBJ)) $(THLIBS_A) $(EXTRAOBJS) | |
37 $(call LINK_C_BIN,) | |
38 | |
39 | |
40 # | |
41 # Documentation | |
42 # | |
43 $(DOC): | |
44 @cat doc/index.html | tr '\n' '§' | sed "s/<.-- BEGIN -->.*<.-- END -->//g;s/<script.*<\/script>//g" | tr '§' '\n' > "$@.tmp" | |
45 @links -dump "$@.tmp" > $@ | |
46 |