]> bicyclesonthemoon.info Git - ott/enhance/blob - makefile.1.mak
3ea26f608238dcdaa02e85a175fe2c740b12560e
[ott/enhance] / makefile.1.mak
1 # "makefile" is automatically generated from "makefile.1.mak"
2 # 04.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
110 CGI=\
111 bluenh-cgi
112
113 HTM_CGI=\
114 bluenh.htm
115
116 HTM_CGI_1=\
117 bluenh.1.htm
118
119
120 # keep these 2 lists in the same order!:
121 GENERATE_FROM=\
122 online-core.1.h\
123 enhance.1.conf
124
125 TO_GENERATE=\
126 online-core.h\
127 enhance.conf
128
129 DIR=\
130 $(BIN_PATH)\
131 $(TMP_PATH)\
132 $(WWW_PATH)
133
134 SETUID=\
135 $(CGI)
136
137 BIN=\
138 enhance\
139 $(STANDALONE)\
140 $(CGI)
141
142 WWW=\
143 index.htm\
144 $(HTM_CGI)\
145 param.png
146
147 #all: 403 npb npbd npb-ong1 npbd-ong1 bluenh bluenhd insert extract seediff insertframe mremapt-1 compare nofading nofadingd
148 all: $(BIN) $(WWW)
149         
150
151 makefile: makefile.1.mak $(CONFIGFILE)
152         $(CONFIGURE_CMD) < makefile.1.mak > makefile 
153
154
155 enhance: enhance.c core.h core.c $(H_SUBTOOL) $(C_SUBTOOL) $(H_PNG)
156         $(CC) $(CF) -o enhance enhance.c core.c $(C_SUBTOOL) $(L_IL)
157
158 $(STANDALONE): %: standalone-%.c %.c %.h core.c core.h $(H_PNG)
159         $(CC) $(CF) -o $@ standalone-$*.c $*.c core.c $(L_IL)
160
161 $(C_STANDALONE): standalone-%.c: settings-subtool.txt standalone.c
162         $(CONFIGURE) subtool=$* settings-subtool.txt --in standalone.c --out $@
163
164 $(H_SUBTOOL): %.h: settings-subtool.txt subtool.h
165         $(CONFIGURE) subtool=$* settings-subtool.txt --in subtool.h --out $@
166
167 $(TO_GENERATE): $(GENERATE_FROM) $(CONFIGFILE)
168         $(CONFIGURE_CMD) --in $(GENERATE_FROM) --out $(TO_GENERATE)
169         
170 $(CGI): %: %.c online-core.c online-core.h $(H_PNG)
171         $(CC) $(CF) -o $@ $*.c online-core.c $(L_CGI)
172
173 $(H_PNG): %.h: %.png f2h
174         ./f2h $* $*.png $@
175
176 f2h: f2h.c
177         $(CC) $(CF) -o f2h f2h.c
178
179 $(HTM_CGI): %.htm: enhance-top.htm enhance-bottom.htm %.1.htm $(CONFIGFILE)
180         $(CAT) enhance-top.htm $*.1.htm enhance-bottom.htm | $(CONFIGURE) _HTML_TITLE=\$$title_$* $(CONFIGFILE) > bluenh.htm
181
182 index.htm: enhance-top.htm enhance-bottom.htm $(HTM_CGI_1) $(CONFIGFILE)
183         $(CAT) enhance-top.htm $(HTM_CGI_1) enhance-bottom.htm | $(CONFIGURE) _HTML_TITLE=\$$title_enhance $(CONFIGFILE) > index.htm
184
185
186 setuid: $(SETUID)
187         $(CHMOD) u+s,g+s $(SETUID)
188
189 mktree:
190         $(MKDIR) -p $(DIR)
191 #       $(CHMOD) g-r,g-w,g-x,o-r,o-w,o-x $(HIDDEN_DIR)
192
193 ifdef BIN_PATH
194 cp_bin: $(BIN) setuid | mktree
195         $(RM) -rf $(BIN_PATH)/*
196         $(CP) -p $(BIN) $(BIN_PATH)
197 endif
198
199 cp_conf: enhance.conf
200         $(CP) enhance.conf $(CONF)
201
202 cp_www: $(WWW) | mktree
203         $(CP) -r $(WWW) $(WWW_PATH)
204
205 install: cp_bin cp_www cp_conf
206
207 clean:
208         $(RM) -f enhance $(C_STANDALONE) $(STANDALONE) $(TO_GENERATE) f2h $(H_PNG) $(H_SUBTOOL) $(CGI) index.htm $(HTM_CGI)
209
210 PHONY: all clean install setuid mktree cp_bin cp_www
211
212 #npbd-ong1: npb npbd-ong1.cpp makefile
213 #       $(CC) $(CF) -o npbd-ong1 npbd-ong1.cpp $(LF2)
214 #
215 #npbd: npb npbd.cpp makefile
216 #       $(CC) $(CF) -o npbd npbd.cpp $(LF2)
217 #
218 #bluenhd: bluenhd.cpp makefile
219 #       $(CC) $(CF) -o bluenhd bluenhd.cpp $(LF2)
220 #\r
221 #seediff: seediff.c makefile\r
222 #       $(CC) $(CF) $(LF) -o seediff seediff.c\r
223 #\r
224 #insertframe: insertframe.c makefile\r
225 #       $(CC) $(CF) -o insertframe insertframe.c $(LF2)\r
226 #
227 #remapt-1: remapt-1.c makefile
228 #       $(CC) $(CF) $(LF) -o remapt-1 remapt-1.c
229 #
230 #compare: compare.c makefile
231 #       $(CC) $(CF) $(LF) -o compare compare.c
232 #
233 #nofadingd: nofadingd.c makefile
234 #       $(CC) $(CF) $(LF) -o nofadingd nofadingd.c
235 #