]> bicyclesonthemoon.info Git - ott/enhance/blob - makefile.1.mak
Online interface for bluenh. Something is no yes.
[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_CHMOD: CHMOD = chmod
33 ###MAKE_CP:    CP    = cp
34 ###MAKE_MKDIR: MKDIR = mkdir
35 ###MAKE_PERL:  PERL  = perl
36 ###MAKE_RM:    RM    = rm
37
38 ###MAKE_BIN_PATH: BIN_PATH = /botm/bin/ottmirror
39 ###MAKE_TMP_PATH: TMP_PATH = /botm/tmp/ottmirror
40
41
42 CONFIGFILE = settings-$(TARGET).txt settings.txt
43
44 # The configuration tool
45 # http://bicyclesonthemoon.info/git/botm-config 
46 CONFIGURE = /botm/bin/config/configure.pl ###MAKE_CONFIGURE:
47 CONFIGURE_CMD = $(PERL) $(CONFIGURE) $(CONFIGFILE)
48
49
50 STANDALONE=\
51 nofading\
52 info\
53 bluenh\
54 reveal\
55 diff\
56 npb\
57 pal_mix\
58 pal_unmix\
59 pal_mixdiff\
60 remap_t_1
61
62 C_STANDALONE=\
63 standalone-nofading.c\
64 standalone-info.c\
65 standalone-bluenh.c\
66 standalone-reveal.c\
67 standalone-diff.c\
68 standalone-npb.c\
69 standalone-pal_mix.c\
70 standalone-pal_unmix.c\
71 standalone-pal_mixdiff.c\
72 standalone-remap_t_1.c
73
74 C_SUBTOOL=\
75 nofading.c\
76 info.c\
77 bluenh.c\
78 reveal.c\
79 diff.c\
80 npb.c\
81 pal_mix.c\
82 pal_unmix.c\
83 pal_mixdiff.c\
84 remap_t_1.c
85
86 H_SUBTOOL=\
87 nofading.h\
88 info.h\
89 bluenh.h\
90 reveal.h\
91 diff.h\
92 npb.h\
93 pal_mix.h\
94 pal_unmix.h\
95 pal_mixdiff.h\
96 remap_t_1.h
97
98 H_PNG=\
99 npb0.h\
100 npb1.h\
101 npb2.h\
102 npb_ong1.h\
103 npb_403.h\
104 nh.h
105
106 CGI=\
107 bluenh-cgi
108
109 #C_CGI=\
110 #bluenh-cgi.c
111
112
113 # keep these 2 lists in the same order!:
114 GENERATE_FROM=\
115 online-core.1.h
116
117 TO_GENERATE=\
118 online-core.h
119
120 DIR=\
121 $(BIN_PATH)\
122 $(TMP_PATH)
123
124 SETUID=\
125 $(CGI)
126
127 BIN=\
128 enhance\
129 $(STANDALONE)\
130 $(CGI)
131
132
133 #all: 403 npb npbd npb-ong1 npbd-ong1 bluenh bluenhd insert extract seediff insertframe mremapt-1 compare nofading nofadingd
134 all: $(BIN)
135         
136
137 makefile: makefile.1.mak $(CONFIGFILE)
138         $(CONFIGURE_CMD) < makefile.1.mak > makefile 
139
140
141 enhance: enhance.c core.h core.c $(H_SUBTOOL) $(C_SUBTOOL) $(H_PNG)
142         $(CC) $(CF) -o enhance enhance.c core.c $(C_SUBTOOL) $(L_IL)
143
144 $(STANDALONE): %: standalone-%.c %.c %.h core.c core.h $(H_PNG)
145         $(CC) $(CF) -o $@ standalone-$*.c $*.c core.c $(L_IL)
146
147 $(C_STANDALONE): standalone-%.c: settings-subtool.txt standalone.c
148         $(CONFIGURE) subtool=$* settings-subtool.txt --in standalone.c --out $@
149
150 $(H_SUBTOOL): %.h: settings-subtool.txt subtool.h
151         $(CONFIGURE) subtool=$* settings-subtool.txt --in subtool.h --out $@
152
153 $(TO_GENERATE): $(GENERATE_FROM) $(CONFIGFILE)
154         $(CONFIGURE_CMD) --in $(GENERATE_FROM) --out $(TO_GENERATE)
155         
156 $(CGI): %: %.c online-core.c online-core.h $(H_PNG)
157         $(CC) $(CF) -o $@ $*.c online-core.c $(L_CGI)
158
159 $(H_PNG): %.h: %.png f2h
160         ./f2h $* $*.png $@
161
162 f2h: f2h.c
163         $(CC) $(CF) -o f2h f2h.c
164
165
166 setuid: $(SETUID)
167         $(CHMOD) u+s,g+s $(SETUID)
168
169 mktree:
170         $(MKDIR) -p $(DIR)
171 #       $(CHMOD) g-r,g-w,g-x,o-r,o-w,o-x $(HIDDEN_DIR)
172
173 ifdef BIN_PATH
174 cp_bin: $(BIN) setuid | mktree
175         $(RM) -rf $(BIN_PATH)/*
176         $(CP) -p $(BIN) $(BIN_PATH)
177 endif
178
179 install: cp_bin
180
181 clean:
182         $(RM) -f enhance $(C_STANDALONE) $(STANDALONE) $(TO_GENERATE) f2h $(H_PNG) $(H_SUBTOOL) $(CGI)
183
184 PHONY: all clean install setuid mktree cp_bin 
185
186 #npbd-ong1: npb npbd-ong1.cpp makefile
187 #       $(CC) $(CF) -o npbd-ong1 npbd-ong1.cpp $(LF2)
188 #
189 #npbd: npb npbd.cpp makefile
190 #       $(CC) $(CF) -o npbd npbd.cpp $(LF2)
191 #
192 #bluenhd: bluenhd.cpp makefile
193 #       $(CC) $(CF) -o bluenhd bluenhd.cpp $(LF2)
194 #\r
195 #seediff: seediff.c makefile\r
196 #       $(CC) $(CF) $(LF) -o seediff seediff.c\r
197 #\r
198 #insertframe: insertframe.c makefile\r
199 #       $(CC) $(CF) -o insertframe insertframe.c $(LF2)\r
200 #
201 #remapt-1: remapt-1.c makefile
202 #       $(CC) $(CF) $(LF) -o remapt-1 remapt-1.c
203 #
204 #compare: compare.c makefile
205 #       $(CC) $(CF) $(LF) -o compare compare.c
206 #
207 #nofadingd: nofadingd.c makefile
208 #       $(CC) $(CF) $(LF) -o nofadingd nofadingd.c
209 #