menu now ALWAYS works in a subwindow of 5:4 aspect, scaled to just fit in. Should...
[divverent/nexuiz.git] / data / Makefile
1 FTEQCC ?= fteqcc
2 PERL ?= perl
3 PK3NAME ?= `date +../data%Y%m%d.pk3`
4 ZIP ?= 7za a -tzip -mx=9
5 ZIPEXCLUDE ?= -x\!*.pk3 -xr\!\.svn -x\!qcsrc
6 DIFF ?= diff
7
8 FTEQCCFLAGS ?= -Werror -Wall -Wno-mundane -O3 -Ono-c -Ono-cs -flo
9 FTEQCCFLAGS_PROGS ?= 
10 FTEQCCFLAGS_MENU ?= 
11
12 # NOTE: use -DUSE_FTE instead of -TFTE here!
13 # It will automagically add an engine check with -TID and then change back to -TFTE
14 FTEQCCFLAGS_CSPROGS ?= 
15
16 # nexuiz svn build system overrides this by command line argument
17 NEX_BUILDSYSTEM =
18
19 all: qc
20
21 .PHONY: update-cvarcount
22 update-cvarcount:
23         [ "$(NEX_BUILDSYSTEM)" = "" ] || [ "$(NEX_BUILDSYSTEM)" = "1" ]
24         [ "$(NEX_BUILDSYSTEM)" != "" ] || { ! [ -f ../misc/netradiant-NexuizPack/nexuiz.game/data/entities.def ] || $(DIFF) scripts/entities.def ../misc/netradiant-NexuizPack/nexuiz.game/data/entities.def || { echo entities.def mismatch, please merge ../misc/netradiant-NexuizPack/nexuiz.game/data/entities.def and scripts/entities.def; exit 1; }; }
25         [ "$(NEX_BUILDSYSTEM)" != "" ] || { DO_NOT_RUN_MAKE=1 sh update-cvarcount.sh; }
26
27 .PHONY: qc
28 qc: update-cvarcount
29         $(MAKE) qc-recursive
30
31 .PHONY: qc-recursive
32 qc-recursive: menu.dat progs.dat csprogs.dat
33
34 .PHONY: skin
35 skin: gfx/menu/default/skinvalues.txt
36
37 .PHONY: pk3
38 pk3: $(PK3NAME)
39
40 .PHONY: pk3here
41 pk3here: qc
42         $(RM) $(PK3NAME); \
43         set -ex; \
44                 ABSPK3NAME=$(PK3NAME); \
45                 case $$ABSPK3NAME in \
46                         /*) \
47                                 ;; \
48                         *) \
49                                 ABSPK3NAME=$$PWD/$$ABSPK3NAME; \
50                                 ;; \
51                 esac; \
52                 $(ZIP) $(ZIPEXCLUDE) $$ABSPK3NAME .
53
54 .PHONY: clean
55 clean:
56         rm -f progs.dat menu.dat csprogs.dat
57
58 csprogs.dat: qcsrc/client/*.* qcsrc/common/*.*
59         cd qcsrc/client && $(FTEQCC) $(FTEQCCFLAGS) $(FTEQCCFLAGS_CSPROGS)
60
61 progs.dat: qcsrc/server/*.* qcsrc/common/*.* qcsrc/server/*/*.* qcsrc/server/*/*/*.*
62         cd qcsrc/server && $(FTEQCC) $(FTEQCCFLAGS) $(FTEQCCFLAGS_PROGS)
63
64 menu.dat: qcsrc/menu/*.* qcsrc/menu/*/*.* qcsrc/common/*.*
65         cd qcsrc/menu && $(FTEQCC) $(FTEQCCFLAGS) $(FTEQCCFLAGS_MENU)
66
67 gfx/menu/default/skinvalues.txt: qcsrc/menu/skin-customizables.inc
68         $(PERL) qcsrc/menu/skin-customizables.inc > gfx/menu/default/skinvalues.txt
69
70 $(PK3NAME): qc
71         $(RM) $(PK3NAME)
72         set -ex; \
73                 ABSPK3NAME=$(PK3NAME); \
74                 case $$ABSPK3NAME in \
75                         /*) \
76                                 ;; \
77                         *) \
78                                 ABSPK3NAME=$$PWD/$$ABSPK3NAME; \
79                                 ;; \
80                 esac; \
81                 TDIR=`mktemp -d -t nexuizpk3.XXXXXX`; \
82                 cp -v progs.dat csprogs.dat menu.dat $$TDIR/; \
83                 svn export --force . $$TDIR; \
84                 cd $$TDIR; \
85                 $(RM) -r qcsrc common-spog.pk3; \
86                 $(ZIP) $$ABSPK3NAME .
87
88 .PHONY: log
89 log:
90         cd .. && svn log -r HEAD:BASE
91
92 .PHONY: logv
93 logv:
94         cd .. && svn log -r HEAD:BASE -v
95
96 .PHONY: update
97 update:
98         cd .. && svn up
99
100 .PHONY: logupdate
101 logupdate:
102         cd .. && svn log -r HEAD:BASE && svn up
103
104 .PHONY: logvupdate
105 logvupdate:
106         cd .. && svn log -r HEAD:BASE -v && svn up