]> bicyclesonthemoon.info Git - ott/enhance/blob - makefile.1.mak
palette tools online
[ott/enhance] / makefile.1.mak
1 # "makefile" is automatically generated from "makefile.1.mak"
2 # 05.12.2022
3
4 # Copyright (C) 2022  Balthasar SzczepaƄski
5
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.
10
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.
15
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/>.
18
19
20 ifndef TARGET
21 TARGET = debug ###MAKE_TARGET:
22 # when want to change target run this first:
23 # make -B TARGET=target_name makefile
24 endif
25
26
27 ###MAKE_CC:    CC=gcc
28 ###MAKE_CF:    CF=-g -Wall
29 ###MAKE_L_IL:  L_IL=-lIL
30 ###MAKE_L_CGI: L_CGI=-lcgi
31
32 ###MAKE_CAT:   CAT   = cat
33 ###MAKE_CHMOD: CHMOD = chmod
34 ###MAKE_CP:    CP    = cp
35 ###MAKE_MKDIR: MKDIR = mkdir
36 ###MAKE_PERL:  PERL  = perl
37 ###MAKE_RM:    RM    = rm
38
39 ###MAKE_BIN_PATH: BIN_PATH = /botm/bin/enhance
40 ###MAKE_TMP_PATH: TMP_PATH = /botm/tmp/enhance
41 ###MAKE_WWW_PATH: WWW_PATH = /botm/www/1190/enhance
42
43 ###MAKE_CONF: CONF = /botm/etc/www/conf/1190/enhance.conf
44
45
46 CONFIGFILE = settings-$(TARGET).txt settings.txt
47
48 # The configuration tool
49 # http://bicyclesonthemoon.info/git/botm-config 
50 CONFIGURE = /botm/bin/config/configure.pl ###MAKE_CONFIGURE:
51 CONFIGURE_CMD = $(PERL) $(CONFIGURE) $(CONFIGFILE)
52
53
54 STANDALONE=\
55 nofading\
56 info\
57 bluenh\
58 reveal\
59 diff\
60 npb\
61 pal_mix\
62 pal_unmix\
63 pal_mixdiff\
64 remap_t_1
65
66 C_STANDALONE=\
67 standalone-nofading.c\
68 standalone-info.c\
69 standalone-bluenh.c\
70 standalone-reveal.c\
71 standalone-diff.c\
72 standalone-npb.c\
73 standalone-pal_mix.c\
74 standalone-pal_unmix.c\
75 standalone-pal_mixdiff.c\
76 standalone-remap_t_1.c
77
78 C_SUBTOOL=\
79 nofading.c\
80 info.c\
81 bluenh.c\
82 reveal.c\
83 diff.c\
84 npb.c\
85 pal_mix.c\
86 pal_unmix.c\
87 pal_mixdiff.c\
88 remap_t_1.c
89
90 H_SUBTOOL=\
91 nofading.h\
92 info.h\
93 bluenh.h\
94 reveal.h\
95 diff.h\
96 npb.h\
97 pal_mix.h\
98 pal_unmix.h\
99 pal_mixdiff.h\
100 remap_t_1.h
101
102 H_PNG=\
103 npb0.h\
104 npb1.h\
105 npb2.h\
106 npb_ong1.h\
107 npb_403.h\
108 nh.h\
109 nf.h\
110 rvl.h\
111 df.h\
112 mpb.h\
113 mpb_503.h\
114 nclr.h
115
116 CGI=\
117 bluenh-cgi\
118 nofading-cgi\
119 reveal-cgi\
120 diff-cgi\
121 npb-cgi\
122 pal-cgi
123
124 HTM_CGI=\
125 bluenh.htm\
126 nofading.htm\
127 reveal.htm\
128 diff.htm\
129 npb.htm\
130 pal.htm
131
132 HTM_CGI_1=\
133 bluenh.1.htm\
134 nofading.1.htm\
135 reveal.1.htm\
136 diff.1.htm\
137 npb.1.htm\
138 pal.1.htm
139
140 # keep these 2 lists in the same order!:
141 GENERATE_FROM=\
142 online-core.1.h\
143 enhance.1.conf
144
145 TO_GENERATE=\
146 online-core.h\
147 enhance.conf
148
149 DIR=\
150 $(BIN_PATH)\
151 $(TMP_PATH)\
152 $(WWW_PATH)
153
154 SETUID=\
155 $(CGI)
156
157 BIN=\
158 enhance\
159 $(STANDALONE)\
160 $(CGI)
161
162 WWW=\
163 index.htm\
164 $(HTM_CGI)\
165 param.png
166
167 #all: 403 npb npbd npb-ong1 npbd-ong1 bluenh bluenhd insert extract seediff insertframe mremapt-1 compare nofading nofadingd
168 all: $(BIN) $(WWW) enhance.conf
169         
170
171 makefile: makefile.1.mak $(CONFIGFILE)
172         $(CONFIGURE_CMD) < makefile.1.mak > makefile 
173
174
175 enhance: enhance.c core.h core.c $(H_SUBTOOL) $(C_SUBTOOL) $(H_PNG)
176         $(CC) $(CF) -o enhance enhance.c core.c $(C_SUBTOOL) $(L_IL)
177
178 $(STANDALONE): %: standalone-%.c %.c %.h core.c core.h $(H_PNG)
179         $(CC) $(CF) -o $@ standalone-$*.c $*.c core.c $(L_IL)
180
181 $(C_STANDALONE): standalone-%.c: settings-subtool.txt standalone.c
182         $(CONFIGURE) subtool=$* settings-subtool.txt --in standalone.c --out $@
183
184 $(H_SUBTOOL): %.h: settings-subtool.txt subtool.h
185         $(CONFIGURE) subtool=$* settings-subtool.txt --in subtool.h --out $@
186
187 $(TO_GENERATE): $(GENERATE_FROM) $(CONFIGFILE)
188         $(CONFIGURE_CMD) --in $(GENERATE_FROM) --out $(TO_GENERATE)
189         
190 $(CGI): %: %.c online-core.c online-core.h $(H_PNG)
191         $(CC) $(CF) -o $@ $*.c online-core.c $(L_CGI)
192
193 $(H_PNG): %.h: %.png f2h
194         ./f2h $* $*.png $@
195
196 f2h: f2h.c
197         $(CC) $(CF) -o f2h f2h.c
198
199 $(HTM_CGI): %.htm: enhance-top.htm enhance-bottom.htm %.1.htm $(CONFIGFILE)
200         $(CAT) enhance-top.htm $*.1.htm enhance-bottom.htm | $(CONFIGURE) _HTML_TITLE=\$$title_$* $(CONFIGFILE) > $*.htm
201
202 index.htm: enhance-top.htm enhance-bottom.htm $(HTM_CGI_1) $(CONFIGFILE)
203         $(CAT) enhance-top.htm $(HTM_CGI_1) enhance-bottom.htm | $(CONFIGURE) _HTML_TITLE=\$$title_enhance $(CONFIGFILE) > index.htm
204
205
206 setuid: $(SETUID)
207         $(CHMOD) u+s,g+s $(SETUID)
208
209 mktree:
210         $(MKDIR) -p $(DIR)
211 #       $(CHMOD) g-r,g-w,g-x,o-r,o-w,o-x $(HIDDEN_DIR)
212
213 ifdef BIN_PATH
214 cp_bin: $(BIN) setuid | mktree
215         $(RM) -rf $(BIN_PATH)/*
216         $(CP) -p $(BIN) $(BIN_PATH)
217 endif
218
219 cp_conf: enhance.conf
220         $(CP) enhance.conf $(CONF)
221
222 cp_www: $(WWW) | mktree
223         $(CP) -r $(WWW) $(WWW_PATH)
224
225 install: cp_bin cp_www cp_conf
226
227 clean:
228         $(RM) -f enhance $(C_STANDALONE) $(STANDALONE) $(TO_GENERATE) f2h $(H_PNG) $(H_SUBTOOL) $(CGI) index.htm $(HTM_CGI)
229
230 PHONY: all clean install setuid mktree cp_bin cp_www
231
232 #npbd-ong1: npb npbd-ong1.cpp makefile
233 #       $(CC) $(CF) -o npbd-ong1 npbd-ong1.cpp $(LF2)
234 #
235 #npbd: npb npbd.cpp makefile
236 #       $(CC) $(CF) -o npbd npbd.cpp $(LF2)
237 #
238 #bluenhd: bluenhd.cpp makefile
239 #       $(CC) $(CF) -o bluenhd bluenhd.cpp $(LF2)
240 #\r
241 #seediff: seediff.c makefile\r
242 #       $(CC) $(CF) $(LF) -o seediff seediff.c\r
243 #\r
244 #insertframe: insertframe.c makefile\r
245 #       $(CC) $(CF) -o insertframe insertframe.c $(LF2)\r
246 #
247 #remapt-1: remapt-1.c makefile
248 #       $(CC) $(CF) $(LF) -o remapt-1 remapt-1.c
249 #
250 #compare: compare.c makefile
251 #       $(CC) $(CF) $(LF) -o compare compare.c
252 #
253 #nofadingd: nofadingd.c makefile
254 #       $(CC) $(CF) $(LF) -o nofadingd nofadingd.c
255 #