1 # "makefile" is automatically generated from "makefile.1.mak"
\r
3 # Copyright (C) 2023, 2024 Balthasar SzczepaĆski
\r
5 # This program is free software: you can redistribute it and/or modify
\r
6 # it under the terms of the GNU Affero General Public License as
\r
7 # published by the Free Software Foundation, either version 3 of the
\r
8 # License, or (at your option) any later version.
\r
10 # This program is distributed in the hope that it will be useful,
\r
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
13 # GNU Affero General Public License for more details.
\r
15 # You should have received a copy of the GNU Affero General Public License
\r
16 # along with this program. If not, see <http://www.gnu.org/licenses/>.
\r
18 DEFAULT_TARGET = debug
\r
20 TARGET = $(DEFAULT_TARGET) ###MAKE_TARGET:
\r
21 # when want to change target run this first:
\r
22 # make -B TARGET=target_name makefile
\r
27 ###MAKE_CF: CF=-g -Wall
\r
29 ###MAKE_CHMOD: CHMOD = chmod
\r
31 ###MAKE_MKDIR: MKDIR = mkdir
\r
33 ###MAKE_PERL: PERL = perl
\r
35 ###MAKE_BIN_PATH: BIN_PATH = /botm/bin/post
\r
36 ###MAKE_DATA_PATH: DATA_PATH = /botm/data/post
\r
37 ###MAKE_DATA_FAIL_PATH: DATA_FAIL_PATH = /botm/data/post/fail
\r
38 ###MAKE_DATA_SENT_PATH: DATA_SENT_PATH = /botm/data/post/sent
\r
39 ###MAKE_DATA_WAIT_PATH: DATA_WAIT_PATH = /botm/data/post/wait
\r
40 ###MAKE_LIB_PATH: LIB_PATH = /botm/lib/post
\r
41 ###MAKE_TMP_PATH: TMP_PATH = /botm/tmp/post
\r
44 CONFIGFILE = settings-$(TARGET).txt settings.txt
\r
45 DEFAULT_CONFIGFILE = settings-$(DEFAULT_TARGET).txt settings.txt
\r
47 # The configuration tool
\r
48 CONFIGURE_CMD = $(PERL) ./configure.pl --do $(CONFIGFILE)
\r
50 # keep these 2 lists in the same order!:
\r
99 botm-common/botm_common.pm\
\r
102 all: $(BIN) setuid exec
\r
104 makefile: makefile.1.mak $(CONFIGFILE) configure.pl
\r
105 $(CONFIGURE_CMD) --in makefile.1.mak --out makefile
\r
107 configure.pl: $(CONFIGFILE) config/configure.1.pl
\r
108 $(PERL) config/configure.1.pl target=direct settings-$(TARGET).txt config/settings.txt --in config/configure.1.pl --out configure.pl
\r
111 $(TO_GENERATE): $(GENERATE_FROM) $(CONFIGFILE) configure.pl
\r
112 $(CONFIGURE_CMD) --in $(GENERATE_FROM) --out $(TO_GENERATE)
\r
114 $(PERL_WRAP_EXEC): %: exec/exec.c exec/settings.txt configure.pl
\r
115 $(PERL) configure.pl path=$(BIN_PATH) target=$*.pl exec/settings.txt --in exec/exec.c --out $*.c
\r
116 $(CC) $(CF) -o $@ $*.c
\r
119 $(CHMOD) +x $(EXEC)
\r
122 $(CHMOD) u+s,g+s $(SETUID)
\r
127 $(CHMOD) g-r,g-w,g-x,o-r,o-w,o-x $(HIDDEN_DIR)
\r
130 cp_bin: $(BIN) setuid exec | mktree
\r
131 $(RM) -f $(BIN_PATH)/*
\r
132 $(CP) -p $(BIN) $(BIN_PATH)
\r
136 cp_lib: $(LIB) | mktree
\r
137 $(RM) -f $(LIB_PATH)/*
\r
138 $(CP) -p $(LIB) $(LIB_PATH)
\r
141 install: all cp_bin cp_lib
\r
144 $(RM) -f configure.pl $(TO_GENERATE) $(PERL_WRAP_EXEC) $(PERL_WRAP_EXEC:=.c)
\r
145 $(PERL) config/configure.1.pl --do $(DEFAULT_CONFIGFILE) --in makefile.1.mak --out makefile
\r
147 PHONY: all clean install setuid exec mktree cp_bin cp_lib
\r
158 # all: posted mpview remove post bot5 upload viewer enable
\r
160 # bot5: bot5.c post.awk mpost.awk makefile
\r
161 # $(CC) $(CF) -o bot5 bot5.c
\r
163 # # deliver: deliver.c
\r
164 # # $(CC) $(CF) -o deliver deliver.c
\r
166 # remove: remove.c verify.awk
\r
167 # $(CC) $(CF) -o remove remove.c $(LF2)
\r
169 # mpview: mpview.c mview.awk verify.awk makefile
\r
170 # $(CC) $(CF) -o mpview mpview.c $(LF2)
\r
172 # posted: posted.c posted.awk makefile
\r
173 # $(CC) $(CF) -o posted posted.c $(LF2)
\r
175 # post: post.cpp preview.awk bb2html.awk verify.awk makefile
\r
176 # $(CC2) $(CF) -o post post.cpp $(LF2)
\r
178 # upload: upload.c upload.awk makefile
\r
179 # $(CC) $(CF) -o upload upload.c $(LF2)
\r
181 # viewer: viewer.c makefile
\r
182 # $(CC) $(CF) -o viewer viewer.c $(LF2)
\r
184 # enable: posted mpview remove post upload viewer
\r
185 # chmod u+s posted mpview remove post upload viewer
\r