Mercurial > hg > batmud > maputils
annotate Makefile.common @ 2834:f08e17b1e003 default tip
New pcity 'Zhuque' in Lucentium.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Tue, 11 Jun 2024 12:56:47 +0300 |
parents | f70c996a4a68 |
children |
rev | line source |
---|---|
1547 | 1 ### |
2 ### Include configuration | |
3 ### | |
344 | 4 include config.mak |
2506
de2e01e4343b
Large refactoring and cleanup of the build system.
Matti Hamalainen <ccr@tnsp.org>
parents:
2423
diff
changeset
|
5 include Makefile.paths |
1884 | 6 |
2629 | 7 CFLAGS += -DTH_PROG_AUTHOR="\"By Matti 'ccr' Hamalainen (C) Copyright 2006-2024 TNSP\"" |
2522
2b48d0ed6b56
Move some CFLAGS from config.mak to Makefile.common.
Matti Hamalainen <ccr@tnsp.org>
parents:
2516
diff
changeset
|
8 CFLAGS += -DTH_PROG_LICENSE="\"This software is distributed under GNU General Public License version 2\"" |
2b48d0ed6b56
Move some CFLAGS from config.mak to Makefile.common.
Matti Hamalainen <ccr@tnsp.org>
parents:
2516
diff
changeset
|
9 |
1884 | 10 |
11 ### | |
2242
15a2a7d652b7
Fix to work with changes in th-libs build system hooks.
Matti Hamalainen <ccr@tnsp.org>
parents:
2237
diff
changeset
|
12 ### Binaries and objects |
1547 | 13 ### |
1622
a7d89044ee1b
Restructuring the repository.
Matti Hamalainen <ccr@tnsp.org>
parents:
1559
diff
changeset
|
14 LIBLOCFILE_OBJ=$(OBJPATH)liblocfile.o |
a7d89044ee1b
Restructuring the repository.
Matti Hamalainen <ccr@tnsp.org>
parents:
1559
diff
changeset
|
15 LIBMAPUTILS_OBJ=$(OBJPATH)libmaputils.o |
22
05cf77d10907
Removed files (moved to old/); Updated Makefile to conform.
Matti Hamalainen <ccr@tnsp.org>
parents:
20
diff
changeset
|
16 |
1884 | 17 |
1622
a7d89044ee1b
Restructuring the repository.
Matti Hamalainen <ccr@tnsp.org>
parents:
1559
diff
changeset
|
18 TARGETS += $(LIBMAPUTILS_OBJ) $(LIBLOCFILE_OBJ) \ |
2088
a0eb0ccd6458
Rename mkspecial -> stitchmap.
Matti Hamalainen <ccr@tnsp.org>
parents:
2047
diff
changeset
|
19 $(COLORMAP_BIN) $(STITCHMAP_BIN) $(MKCITYMAP_BIN) \ |
1622
a7d89044ee1b
Restructuring the repository.
Matti Hamalainen <ccr@tnsp.org>
parents:
1559
diff
changeset
|
20 $(DIFFMAP_BIN) $(PATCHMAP_BIN) $(MAP2PPM_BIN) \ |
2249
da51d0e3d85a
Add makefile option to disable building of map file targets.
Matti Hamalainen <ccr@tnsp.org>
parents:
2244
diff
changeset
|
21 $(MKLOC_BIN) $(COMBINE_BIN) $(MAPSTATS_BIN) |
da51d0e3d85a
Add makefile option to disable building of map file targets.
Matti Hamalainen <ccr@tnsp.org>
parents:
2244
diff
changeset
|
22 |
da51d0e3d85a
Add makefile option to disable building of map file targets.
Matti Hamalainen <ccr@tnsp.org>
parents:
2244
diff
changeset
|
23 ifneq ($(BUILD_MAPS),no) |
2316
2a920c6b58c8
Move few definitions and settings from Makefile.gen to config.mak
Matti Hamalainen <ccr@tnsp.org>
parents:
2249
diff
changeset
|
24 TARGETS += $(addprefix $(MISC_MAPS_PATH),$(addsuffix .html,$(MISC_MAPS))) |
2249
da51d0e3d85a
Add makefile option to disable building of map file targets.
Matti Hamalainen <ccr@tnsp.org>
parents:
2244
diff
changeset
|
25 endif |
1622
a7d89044ee1b
Restructuring the repository.
Matti Hamalainen <ccr@tnsp.org>
parents:
1559
diff
changeset
|
26 |
1767
aba021739dae
Actually make the pkg-config libpng autodetect work.
Matti Hamalainen <ccr@tnsp.org>
parents:
1766
diff
changeset
|
27 |
1784
9ee269ae165d
Initial import of map search WebSockets server code. Does not actually do
Matti Hamalainen <ccr@tnsp.org>
parents:
1767
diff
changeset
|
28 ifeq ($(HAVE_LIBWEBSOCKETS),yes) |
1835
8a3da04829f3
Enable mapsearch in the default builds, if libwebsockets is found.
Matti Hamalainen <ccr@tnsp.org>
parents:
1784
diff
changeset
|
29 TARGETS += $(MAPSEARCH_BIN) |
1784
9ee269ae165d
Initial import of map search WebSockets server code. Does not actually do
Matti Hamalainen <ccr@tnsp.org>
parents:
1767
diff
changeset
|
30 MAPSEARCH_CFLAGS += -D_POSIX_C_SOURCE=200112 $(LIBWEBSOCKETS_CFLAGS) |
2102
861137feb73c
Oops, totally forgot the build system changes from previous commit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2088
diff
changeset
|
31 MAPSEARCH_LDFLAGS += $(LIBWEBSOCKETS_LDFLAGS) -lm |
1784
9ee269ae165d
Initial import of map search WebSockets server code. Does not actually do
Matti Hamalainen <ccr@tnsp.org>
parents:
1767
diff
changeset
|
32 endif |
9ee269ae165d
Initial import of map search WebSockets server code. Does not actually do
Matti Hamalainen <ccr@tnsp.org>
parents:
1767
diff
changeset
|
33 |
1766
914543dfada1
Autodetect libpng via pkg-config.
Matti Hamalainen <ccr@tnsp.org>
parents:
1764
diff
changeset
|
34 ifeq ($(HAVE_LIBPNG),yes) |
2227
e452fa9e7bae
New Makefile for cross-building Win32/64 versions of the tools. Not very
Matti Hamalainen <ccr@tnsp.org>
parents:
2216
diff
changeset
|
35 MAP2PPM_CFLAGS += -DHAVE_LIBPNG=1 $(LIBPNG_CFLAGS) $(ZLIB_CFLAGS) |
e452fa9e7bae
New Makefile for cross-building Win32/64 versions of the tools. Not very
Matti Hamalainen <ccr@tnsp.org>
parents:
2216
diff
changeset
|
36 MAP2PPM_LDFLAGS += $(LIBPNG_LDFLAGS) $(ZLIB_LDFLAGS) -lm |
1766
914543dfada1
Autodetect libpng via pkg-config.
Matti Hamalainen <ccr@tnsp.org>
parents:
1764
diff
changeset
|
37 endif |
914543dfada1
Autodetect libpng via pkg-config.
Matti Hamalainen <ccr@tnsp.org>
parents:
1764
diff
changeset
|
38 |
1767
aba021739dae
Actually make the pkg-config libpng autodetect work.
Matti Hamalainen <ccr@tnsp.org>
parents:
1766
diff
changeset
|
39 |
2017 | 40 ### |
41 ### Include th-libs build system bits | |
42 ### | |
1754
3280d419f1c8
Improve GMaps XML/JSON output by adding links to quests etc.
Matti Hamalainen <ccr@tnsp.org>
parents:
1719
diff
changeset
|
43 THLIBS_OBJ = th_util.o th_string.o th_args.o th_datastruct.o |
1622
a7d89044ee1b
Restructuring the repository.
Matti Hamalainen <ccr@tnsp.org>
parents:
1559
diff
changeset
|
44 |
2017 | 45 include $(THLIBS)/Makefile.inc |
46 | |
7 | 47 |
1547 | 48 ### |
2017 | 49 ### Binary target rules |
1547 | 50 ### |
2346
2dd99055f6d8
Move C source code under src/ subdirectory.
Matti Hamalainen <ccr@tnsp.org>
parents:
2316
diff
changeset
|
51 $(OBJPATH)%.o: src/%.c $(THLIBS_A) |
2422 | 52 $(call COMPILE_C_OBJ, -I$(THLIBS)) |
36 | 53 |
2237
f9e5a67cd117
Rename EXEEXT to BINEXT in the build system, as per changes in th-libs build system.
Matti Hamalainen <ccr@tnsp.org>
parents:
2227
diff
changeset
|
54 $(BINPATH)%$(BINEXT): $(OBJPATH)%.o $(LIBMAPUTILS_OBJ) $(LIBLOCFILE_OBJ) $(THLIBS_A) $(THLIBS_DEP) |
2422 | 55 $(call LINK_C_BIN,) |
1784
9ee269ae165d
Initial import of map search WebSockets server code. Does not actually do
Matti Hamalainen <ccr@tnsp.org>
parents:
1767
diff
changeset
|
56 |
1176
efeeeba8391b
Add mkcitymap to Makefile.
Matti Hamalainen <ccr@tnsp.org>
parents:
1096
diff
changeset
|
57 |
2346
2dd99055f6d8
Move C source code under src/ subdirectory.
Matti Hamalainen <ccr@tnsp.org>
parents:
2316
diff
changeset
|
58 $(OBJPATH)map2ppm.o: src/map2ppm.c $(THLIBS_A) |
2422 | 59 $(call COMPILE_C_OBJ, $(MAP2PPM_CFLAGS)) |
2017 | 60 |
61 $(MAP2PPM_BIN): $(OBJPATH)map2ppm.o $(LIBMAPUTILS_OBJ) $(THLIBS_A) $(THLIBS_DEP) | |
2422 | 62 $(call LINK_C_BIN, $(MAP2PPM_LDFLAGS) $(THLIBS_A)) |
97 | 63 |
1251
e5043a5fabb8
Build th-libs out of tree.
Matti Hamalainen <ccr@tnsp.org>
parents:
1197
diff
changeset
|
64 |
2346
2dd99055f6d8
Move C source code under src/ subdirectory.
Matti Hamalainen <ccr@tnsp.org>
parents:
2316
diff
changeset
|
65 $(OBJPATH)mapsearch.o: src/mapsearch.c $(THLIBS_A) |
2422 | 66 $(call COMPILE_C_OBJ, $(MAPSEARCH_CFLAGS)) |
2017 | 67 |
68 $(MAPSEARCH_BIN): $(OBJPATH)mapsearch.o $(LIBMAPUTILS_OBJ) $(LIBLOCFILE_OBJ) $(THLIBS_A) $(THLIBS_DEP) | |
2422 | 69 $(call LINK_C_BIN, $(MAPSEARCH_LDFLAGS) $(THLIBS_A)) |
2017 | 70 |
71 | |
72 ### | |
2506
de2e01e4343b
Large refactoring and cleanup of the build system.
Matti Hamalainen <ccr@tnsp.org>
parents:
2423
diff
changeset
|
73 ### Misc map targets |
2017 | 74 ### |
2561
94ced9325593
Remove useless dependency from rule.
Matti Hamalainen <ccr@tnsp.org>
parents:
2524
diff
changeset
|
75 $(MISC_MAPS_PATH)%.html: $(MISC_MAPS_PATH)%.map $(MISC_MAPS_PATH)%.loc $(MISC_MAPS_PATH)%.desc $(MKCITYMAP_BIN) $(MISC_MAPS_PATH)misc.html |
2423
6b9380f55571
Improve build system slightly.
Matti Hamalainen <ccr@tnsp.org>
parents:
2422
diff
changeset
|
76 @$(call DO_CMD,MKCITYMAP,$@,$(MKCITYMAP_BIN) $(MKCITYMAP_OPTS) -h $(MISC_MAPS_PATH)misc.html -t "`cat $(patsubst %.map,%.desc,$<)`" $< $(patsubst %.map,%.loc,$<) `cat $(patsubst %.map,%.opts,$<)` -o "$@") |
1 | 77 |
1180
389e9499f8f9
Build Arelium map with mkcitymap now.
Matti Hamalainen <ccr@tnsp.org>
parents:
1176
diff
changeset
|
78 |
1547 | 79 ### |
80 ### Special targets | |
81 ### | |
2575
9d147f7d809c
Rename util.js to worldmap.js to better reflect its functionality.
Matti Hamalainen <ccr@tnsp.org>
parents:
2562
diff
changeset
|
82 upload: src/tooltip.js src/citymap.js src/worldmap.js $(MISC_MAPS_PATH)misc.css \ |
2316
2a920c6b58c8
Move few definitions and settings from Makefile.gen to config.mak
Matti Hamalainen <ccr@tnsp.org>
parents:
2249
diff
changeset
|
83 $(addprefix $(MISC_MAPS_PATH),$(addsuffix .html,$(MISC_MAPS))) \ |
2a920c6b58c8
Move few definitions and settings from Makefile.gen to config.mak
Matti Hamalainen <ccr@tnsp.org>
parents:
2249
diff
changeset
|
84 $(addprefix $(MISC_MAPS_PATH),$(addsuffix .map,$(MISC_MAPS))) \ |
2a920c6b58c8
Move few definitions and settings from Makefile.gen to config.mak
Matti Hamalainen <ccr@tnsp.org>
parents:
2249
diff
changeset
|
85 $(addprefix $(MISC_MAPS_PATH),$(addsuffix .loc,$(MISC_MAPS))) |
2524
73f3062d717c
Rename two Makefile variables.
Matti Hamalainen <ccr@tnsp.org>
parents:
2522
diff
changeset
|
86 $(RSCP_COMMAND) $? $(RSCP_UPLOAD_URL) |
594 | 87 @touch $@ |