]> bicyclesonthemoon.info Git - ott/enhance/blob - makefile
8ae88dc3b7cab1dca3c80c8b14b04483ab2794ef
[ott/enhance] / makefile
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    = release
22 # when want to change target run this first:
23 # make -B TARGET=target_name makefile
24 endif
25
26
27 CC   =gcc
28 CF   =-g -Wall
29 L_IL =-lIL
30 L_CGI=-lcgi
31
32 CAT  =/usr/bin/cat
33 CHMOD=/usr/bin/chmod
34 CP   =/usr/bin/cp
35 MKDIR=/usr/bin/mkdir
36 PERL =/usr/bin/perl
37 RM   =/usr/bin/rm
38
39 BIN_PATH = /botm/bin/enhance
40 TMP_PATH = /botm/tmp/enhance
41 WWW_PATH = /botm/www/1190/enhance
42
43 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
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
115 CGI=\
116 bluenh-cgi\
117 nofading-cgi\
118 reveal-cgi\
119 diff-cgi\
120 npb-cgi
121
122 HTM_CGI=\
123 bluenh.htm\
124 nofading.htm\
125 reveal.htm\
126 diff.htm\
127 npb.htm
128
129 HTM_CGI_1=\
130 bluenh.1.htm\
131 nofading.1.htm\
132 reveal.1.htm\
133 diff.1.htm\
134 npb.1.htm
135
136 # keep these 2 lists in the same order!:
137 GENERATE_FROM=\
138 online-core.1.h\
139 enhance.1.conf
140
141 TO_GENERATE=\
142 online-core.h\
143 enhance.conf
144
145 DIR=\
146 $(BIN_PATH)\
147 $(TMP_PATH)\
148 $(WWW_PATH)
149
150 SETUID=\
151 $(CGI)
152
153 BIN=\
154 enhance\
155 $(STANDALONE)\
156 $(CGI)
157
158 WWW=\
159 index.htm\
160 $(HTM_CGI)\
161 param.png
162
163 #all: 403 npb npbd npb-ong1 npbd-ong1 bluenh bluenhd insert extract seediff insertframe mremapt-1 compare nofading nofadingd
164 all: $(BIN) $(WWW) enhance.conf
165         
166
167 makefile: makefile.1.mak $(CONFIGFILE)
168         $(CONFIGURE_CMD) < makefile.1.mak > makefile 
169
170
171 enhance: enhance.c core.h core.c $(H_SUBTOOL) $(C_SUBTOOL) $(H_PNG)
172         $(CC) $(CF) -o enhance enhance.c core.c $(C_SUBTOOL) $(L_IL)
173
174 $(STANDALONE): %: standalone-%.c %.c %.h core.c core.h $(H_PNG)
175         $(CC) $(CF) -o $@ standalone-$*.c $*.c core.c $(L_IL)
176
177 $(C_STANDALONE): standalone-%.c: settings-subtool.txt standalone.c
178         $(CONFIGURE) subtool=$* settings-subtool.txt --in standalone.c --out $@
179
180 $(H_SUBTOOL): %.h: settings-subtool.txt subtool.h
181         $(CONFIGURE) subtool=$* settings-subtool.txt --in subtool.h --out $@
182
183 $(TO_GENERATE): $(GENERATE_FROM) $(CONFIGFILE)
184         $(CONFIGURE_CMD) --in $(GENERATE_FROM) --out $(TO_GENERATE)
185         
186 $(CGI): %: %.c online-core.c online-core.h $(H_PNG)
187         $(CC) $(CF) -o $@ $*.c online-core.c $(L_CGI)
188
189 $(H_PNG): %.h: %.png f2h
190         ./f2h $* $*.png $@
191
192 f2h: f2h.c
193         $(CC) $(CF) -o f2h f2h.c
194
195 $(HTM_CGI): %.htm: enhance-top.htm enhance-bottom.htm %.1.htm $(CONFIGFILE)
196         $(CAT) enhance-top.htm $*.1.htm enhance-bottom.htm | $(CONFIGURE) _HTML_TITLE=\$$title_$* $(CONFIGFILE) > $*.htm
197
198 index.htm: enhance-top.htm enhance-bottom.htm $(HTM_CGI_1) $(CONFIGFILE)
199         $(CAT) enhance-top.htm $(HTM_CGI_1) enhance-bottom.htm | $(CONFIGURE) _HTML_TITLE=\$$title_enhance $(CONFIGFILE) > index.htm
200
201
202 setuid: $(SETUID)
203         $(CHMOD) u+s,g+s $(SETUID)
204
205 mktree:
206         $(MKDIR) -p $(DIR)
207 #       $(CHMOD) g-r,g-w,g-x,o-r,o-w,o-x $(HIDDEN_DIR)
208
209 ifdef BIN_PATH
210 cp_bin: $(BIN) setuid | mktree
211         $(RM) -rf $(BIN_PATH)/*
212         $(CP) -p $(BIN) $(BIN_PATH)
213 endif
214
215 cp_conf: enhance.conf
216         $(CP) enhance.conf $(CONF)
217
218 cp_www: $(WWW) | mktree
219         $(CP) -r $(WWW) $(WWW_PATH)
220
221 install: cp_bin cp_www cp_conf
222
223 clean:
224         $(RM) -f enhance $(C_STANDALONE) $(STANDALONE) $(TO_GENERATE) f2h $(H_PNG) $(H_SUBTOOL) $(CGI) index.htm $(HTM_CGI)
225
226 PHONY: all clean install setuid mktree cp_bin cp_www
227
228 #npbd-ong1: npb npbd-ong1.cpp makefile
229 #       $(CC) $(CF) -o npbd-ong1 npbd-ong1.cpp $(LF2)
230 #
231 #npbd: npb npbd.cpp makefile
232 #       $(CC) $(CF) -o npbd npbd.cpp $(LF2)
233 #
234 #bluenhd: bluenhd.cpp makefile
235 #       $(CC) $(CF) -o bluenhd bluenhd.cpp $(LF2)
236 #
237 #seediff: seediff.c makefile
238 #       $(CC) $(CF) $(LF) -o seediff seediff.c
239 #
240 #insertframe: insertframe.c makefile
241 #       $(CC) $(CF) -o insertframe insertframe.c $(LF2)
242 #
243 #remapt-1: remapt-1.c makefile
244 #       $(CC) $(CF) $(LF) -o remapt-1 remapt-1.c
245 #
246 #compare: compare.c makefile
247 #       $(CC) $(CF) $(LF) -o compare compare.c
248 #
249 #nofadingd: nofadingd.c makefile
250 #       $(CC) $(CF) $(LF) -o nofadingd nofadingd.c
251 #