1 # "makefile" is automatically generated from "makefile.1.mak"
3 # Copyright (C) 2022, 2024 Balthasar SzczepaĆski
5 # This program is free software: you can redistribute it and/or modify
6 # it under the terms of the GNU Affero General Public License as
7 # published by the Free Software Foundation, either version 3 of the
8 # License, or (at your option) any later version.
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU Affero General Public License for more details.
15 # You should have received a copy of the GNU Affero General Public License
16 # along with this program. If not, see <http://www.gnu.org/licenses/>.
20 DEFAULT_TARGET = debug
22 TARGET = $(DEFAULT_TARGET) ###MAKE_TARGET:
23 # when want to change target run this first:
24 # make -B TARGET=target_name makefile
30 ###MAKE_CF: CF=-g -Wall
31 ###MAKE_L_IL: L_IL=-lIL
32 ###MAKE_L_CGI: L_CGI=-lcgi
34 ###MAKE_CAT: CAT = cat
35 ###MAKE_CHMOD: CHMOD = chmod
37 ###MAKE_MKDIR: MKDIR = mkdir
38 ###MAKE_PERL: PERL = perl
41 ###MAKE_BIN_PATH: BIN_PATH = /botm/bin/enhance
42 ###MAKE_TMP_PATH: TMP_PATH = /botm/tmp/enhance
43 ###MAKE_WWW_PATH: WWW_PATH = /botm/www/1190/enhance
45 ###MAKE_CONF: CONF = /botm/etc/www/conf/1190/enhance.conf
48 CONFIGFILE = settings-$(TARGET).txt settings.txt
49 DEFAULT_CONFIGFILE = settings-$(DEFAULT_TARGET).txt settings.txt
51 # The configuration tool
52 # http://bicyclesonthemoon.info/git/botm-config
53 CONFIGURE = $(PERL) ./configure.pl --do
54 CONFIGURE_CMD = $(CONFIGURE) $(CONFIGFILE)
70 standalone-nofading.c\
77 standalone-pal_unmix.c\
78 standalone-pal_mixdiff.c\
79 standalone-remap_t_1.c
147 # keep these 2 lists in the same order!:
174 all: $(BIN) $(WWW) enhance.conf
177 makefile: makefile.1.mak $(CONFIGFILE) configure.pl
178 $(CONFIGURE_CMD) --in makefile.1.mak --out makefile
180 configure.pl: $(CONFIGFILE) config/configure.1.pl
181 $(PERL) config/configure.1.pl --do target=direct settings-$(TARGET).txt config/settings.txt --in config/configure.1.pl --out configure.pl
184 enhance: enhance.c core.h core.c $(H_SUBTOOL) $(C_SUBTOOL) $(H_PNG)
185 $(CC) $(CF) -o enhance enhance.c core.c $(C_SUBTOOL) $(L_IL)
187 $(STANDALONE): %: standalone-%.c %.c %.h core.c core.h $(H_PNG)
188 $(CC) $(CF) -o $@ standalone-$*.c $*.c core.c $(L_IL)
190 $(C_STANDALONE): standalone-%.c: settings-subtool.txt standalone.c configure.pl
191 $(CONFIGURE) subtool=$* settings-subtool.txt --in standalone.c --out $@
193 $(H_SUBTOOL): %.h: settings-subtool.txt subtool.h configure.pl
194 $(CONFIGURE) subtool=$* settings-subtool.txt --in subtool.h --out $@
196 $(TO_GENERATE): $(GENERATE_FROM) $(CONFIGFILE) configure.pl
197 $(CONFIGURE_CMD) --v --in $(GENERATE_FROM) --out $(TO_GENERATE)
199 $(CGI): %: %.c online-core.c online-core.h $(H_PNG)
200 $(CC) $(CF) -o $@ $*.c online-core.c $(L_CGI)
202 $(H_PNG): %.h: %.png f2h
206 $(CC) $(CF) -o f2h f2h.c
208 $(HTM_CGI): %.htm: enhance-top.htm enhance-bottom.htm %.1.htm $(CONFIGFILE) configure.pl
209 $(CAT) enhance-top.htm $*.1.htm enhance-bottom.htm | $(CONFIGURE) _HTML_TITLE=\$$title_$* $(CONFIGFILE) --out $*.htm
211 index.htm: enhance-top.htm enhance-bottom.htm $(HTM_CGI_1) $(CONFIGFILE) configure.pl
212 $(CAT) enhance-top.htm $(HTM_CGI_1) enhance-bottom.htm | $(CONFIGURE) _HTML_TITLE=\$$title_enhance $(CONFIGFILE) --out index.htm
216 $(CHMOD) u+s,g+s $(SETUID)
220 # $(CHMOD) g-r,g-w,g-x,o-r,o-w,o-x $(HIDDEN_DIR)
223 cp_bin: $(BIN) setuid | mktree
224 $(RM) -f $(BIN_PATH)/*
225 $(CP) -p $(BIN) $(BIN_PATH)
228 cp_conf: enhance.conf
229 $(CP) enhance.conf $(CONF)
231 cp_www: $(WWW) | mktree
232 $(CP) -r $(WWW) $(WWW_PATH)
234 install: all cp_bin cp_www cp_conf
238 $(RM) -f enhance configure.pl $(C_STANDALONE) $(STANDALONE) $(TO_GENERATE) f2h $(H_PNG) $(H_SUBTOOL) $(CGI) index.htm $(HTM_CGI)
239 $(PERL) config/configure.1.pl --do $(DEFAULT_CONFIGFILE) --in makefile.1.mak --out makefile
241 PHONY: all clean install setuid mktree cp_bin cp_www
243 #compare: compare.c makefile
244 # $(CC) $(CF) $(LF) -o compare compare.c