1 # "makefile" is automatically generated from "makefile.1.mak"
4 # Copyright (C) 2022 Balthasar SzczepaĆski
6 # This program is free software: you can redistribute it and/or modify
7 # it under the terms of the GNU Affero General Public License as
8 # published by the Free Software Foundation, either version 3 of the
9 # License, or (at your option) any later version.
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU Affero General Public License for more details.
16 # You should have received a copy of the GNU Affero General Public License
17 # along with this program. If not, see <http://www.gnu.org/licenses/>.
22 # when want to change target run this first:
23 # make -B TARGET=target_name makefile
40 BIN_PATH = /botm/bin/enhance
41 TMP_PATH = /botm/tmp/enhance
42 WWW_PATH = /botm/www/1190/enhance
44 CONF = /botm/etc/www/conf/1190/enhance.conf
47 CONFIGFILE = settings-$(TARGET).txt settings.txt
49 # The configuration tool
50 # http://bicyclesonthemoon.info/git/botm-config
51 CONFIGURE = $(PERL) ./configure.pl
52 CONFIGURE_CMD = $(CONFIGURE) $(CONFIGFILE)
68 standalone-nofading.c\
75 standalone-pal_unmix.c\
76 standalone-pal_mixdiff.c\
77 standalone-remap_t_1.c
145 # keep these 2 lists in the same order!:
172 all: $(BIN) $(WWW) enhance.conf
175 makefile: makefile.1.mak $(CONFIGFILE) configure.pl
176 $(CONFIGURE_CMD) < makefile.1.mak > makefile
178 configure.pl: $(CONFIGFILE) config/configure.1.pl
179 $(PERL) config/configure.1.pl target=direct settings-$(TARGET).txt config/settings.txt --in config/configure.1.pl --out configure.pl
182 enhance: enhance.c core.h core.c $(H_SUBTOOL) $(C_SUBTOOL) $(H_PNG)
183 $(CC) $(CF) -o enhance enhance.c core.c $(C_SUBTOOL) $(L_IL)
185 $(STANDALONE): %: standalone-%.c %.c %.h core.c core.h $(H_PNG)
186 $(CC) $(CF) -o $@ standalone-$*.c $*.c core.c $(L_IL)
188 $(C_STANDALONE): standalone-%.c: settings-subtool.txt standalone.c configure.pl
189 $(CONFIGURE) subtool=$* settings-subtool.txt --in standalone.c --out $@
191 $(H_SUBTOOL): %.h: settings-subtool.txt subtool.h configure.pl
192 $(CONFIGURE) subtool=$* settings-subtool.txt --in subtool.h --out $@
194 $(TO_GENERATE): $(GENERATE_FROM) $(CONFIGFILE) configure.pl
195 $(CONFIGURE_CMD) --in $(GENERATE_FROM) --out $(TO_GENERATE)
197 $(CGI): %: %.c online-core.c online-core.h $(H_PNG)
198 $(CC) $(CF) -o $@ $*.c online-core.c $(L_CGI)
200 $(H_PNG): %.h: %.png f2h
204 $(CC) $(CF) -o f2h f2h.c
206 $(HTM_CGI): %.htm: enhance-top.htm enhance-bottom.htm %.1.htm $(CONFIGFILE) configure.pl
207 $(CAT) enhance-top.htm $*.1.htm enhance-bottom.htm | $(CONFIGURE) _HTML_TITLE=\$$title_$* $(CONFIGFILE) > $*.htm
209 index.htm: enhance-top.htm enhance-bottom.htm $(HTM_CGI_1) $(CONFIGFILE) configure.pl
210 $(CAT) enhance-top.htm $(HTM_CGI_1) enhance-bottom.htm | $(CONFIGURE) _HTML_TITLE=\$$title_enhance $(CONFIGFILE) > index.htm
214 $(CHMOD) u+s,g+s $(SETUID)
218 # $(CHMOD) g-r,g-w,g-x,o-r,o-w,o-x $(HIDDEN_DIR)
221 cp_bin: $(BIN) setuid | mktree
222 $(RM) -f $(BIN_PATH)/*
223 $(CP) -p $(BIN) $(BIN_PATH)
226 cp_conf: enhance.conf
227 $(CP) enhance.conf $(CONF)
229 cp_www: $(WWW) | mktree
230 $(CP) -r $(WWW) $(WWW_PATH)
232 install: all cp_bin cp_www cp_conf
235 $(RM) -f enhance configure.pl $(C_STANDALONE) $(STANDALONE) $(TO_GENERATE) f2h $(H_PNG) $(H_SUBTOOL) $(CGI) index.htm $(HTM_CGI)
237 PHONY: all clean install setuid mktree cp_bin cp_www
239 #compare: compare.c makefile
240 # $(CC) $(CF) $(LF) -o compare compare.c