]> bicyclesonthemoon.info Git - ott/enhance/blobdiff - makefile.1.mak
newpixbot online
[ott/enhance] / makefile.1.mak
index 15d1f317af647cf3da124dd694fedccdbc74b515..0736b7a935661bcf688b0c192d1aac9c707a7a8e 100644 (file)
@@ -1,5 +1,5 @@
 # "makefile" is automatically generated from "makefile.1.mak"
-# 03.12.2022
+# 05.12.2022
 # 
 # Copyright (C) 2022  Balthasar SzczepaƄski
 # 
@@ -23,20 +23,34 @@ TARGET = debug ###MAKE_TARGET:
 # make -B TARGET=target_name makefile
 endif
 
-CONFIGFILE = settings-$(TARGET).txt settings.txt
-
-# The configuration tool
-# http://bicyclesonthemoon.info/git/botm-config 
-CONFIGURE = /botm/bin/config/configure.pl ###MAKE_CONFIGURE:
-CONFIGURE_CMD = $(PERL) $(CONFIGURE) $(CONFIGFILE)
 
 ###MAKE_CC:    CC=gcc
 ###MAKE_CF:    CF=-g -Wall
 ###MAKE_L_IL:  L_IL=-lIL
 ###MAKE_L_CGI: L_CGI=-lcgi
 
+###MAKE_CAT:   CAT   = cat
+###MAKE_CHMOD: CHMOD = chmod
+###MAKE_CP:    CP    = cp
+###MAKE_MKDIR: MKDIR = mkdir
+###MAKE_PERL:  PERL  = perl
 ###MAKE_RM:    RM    = rm
 
+###MAKE_BIN_PATH: BIN_PATH = /botm/bin/enhance
+###MAKE_TMP_PATH: TMP_PATH = /botm/tmp/enhance
+###MAKE_WWW_PATH: WWW_PATH = /botm/www/1190/enhance
+
+###MAKE_CONF: CONF = /botm/etc/www/conf/1190/enhance.conf
+
+
+CONFIGFILE = settings-$(TARGET).txt settings.txt
+
+# The configuration tool
+# http://bicyclesonthemoon.info/git/botm-config 
+CONFIGURE = /botm/bin/config/configure.pl ###MAKE_CONFIGURE:
+CONFIGURE_CMD = $(PERL) $(CONFIGURE) $(CONFIGFILE)
+
+
 STANDALONE=\
 nofading\
 info\
@@ -90,17 +104,65 @@ npb0.h\
 npb1.h\
 npb2.h\
 npb_ong1.h\
-npb_403.h
+npb_403.h\
+nh.h\
+nf.h\
+rvl.h\
+df.h\
+mpb.h\
+mpb_503.h
+
+CGI=\
+bluenh-cgi\
+nofading-cgi\
+reveal-cgi\
+diff-cgi\
+npb-cgi
+
+HTM_CGI=\
+bluenh.htm\
+nofading.htm\
+reveal.htm\
+diff.htm\
+npb.htm
+
+HTM_CGI_1=\
+bluenh.1.htm\
+nofading.1.htm\
+reveal.1.htm\
+diff.1.htm\
+npb.1.htm
 
 # keep these 2 lists in the same order!:
-GENERATE_FROM=
+GENERATE_FROM=\
+online-core.1.h\
+enhance.1.conf
 
-TO_GENERATE=
+TO_GENERATE=\
+online-core.h\
+enhance.conf
 
+DIR=\
+$(BIN_PATH)\
+$(TMP_PATH)\
+$(WWW_PATH)
 
-#all: 403 npb npbd npb-ong1 npbd-ong1 bluenh bluenhd insert extract seediff insertframe mremapt-1 compare nofading nofadingd
-all: enhance $(STANDALONE)
+SETUID=\
+$(CGI)
+
+BIN=\
+enhance\
+$(STANDALONE)\
+$(CGI)
 
+WWW=\
+index.htm\
+$(HTM_CGI)\
+param.png
+
+#all: 403 npb npbd npb-ong1 npbd-ong1 bluenh bluenhd insert extract seediff insertframe mremapt-1 compare nofading nofadingd
+all: $(BIN) $(WWW) enhance.conf
+       
 
 makefile: makefile.1.mak $(CONFIGFILE)
        $(CONFIGURE_CMD) < makefile.1.mak > makefile 
@@ -120,6 +182,9 @@ $(H_SUBTOOL): %.h: settings-subtool.txt subtool.h
 
 $(TO_GENERATE): $(GENERATE_FROM) $(CONFIGFILE)
        $(CONFIGURE_CMD) --in $(GENERATE_FROM) --out $(TO_GENERATE)
+       
+$(CGI): %: %.c online-core.c online-core.h $(H_PNG)
+       $(CC) $(CF) -o $@ $*.c online-core.c $(L_CGI)
 
 $(H_PNG): %.h: %.png f2h
        ./f2h $* $*.png $@
@@ -127,14 +192,38 @@ $(H_PNG): %.h: %.png f2h
 f2h: f2h.c
        $(CC) $(CF) -o f2h f2h.c
 
+$(HTM_CGI): %.htm: enhance-top.htm enhance-bottom.htm %.1.htm $(CONFIGFILE)
+       $(CAT) enhance-top.htm $*.1.htm enhance-bottom.htm | $(CONFIGURE) _HTML_TITLE=\$$title_$* $(CONFIGFILE) > $*.htm
+
+index.htm: enhance-top.htm enhance-bottom.htm $(HTM_CGI_1) $(CONFIGFILE)
+       $(CAT) enhance-top.htm $(HTM_CGI_1) enhance-bottom.htm | $(CONFIGURE) _HTML_TITLE=\$$title_enhance $(CONFIGFILE) > index.htm
+
+
+setuid: $(SETUID)
+       $(CHMOD) u+s,g+s $(SETUID)
+
+mktree:
+       $(MKDIR) -p $(DIR)
+#      $(CHMOD) g-r,g-w,g-x,o-r,o-w,o-x $(HIDDEN_DIR)
+
+ifdef BIN_PATH
+cp_bin: $(BIN) setuid | mktree
+       $(RM) -rf $(BIN_PATH)/*
+       $(CP) -p $(BIN) $(BIN_PATH)
+endif
+
+cp_conf: enhance.conf
+       $(CP) enhance.conf $(CONF)
+
+cp_www: $(WWW) | mktree
+       $(CP) -r $(WWW) $(WWW_PATH)
 
-#test: test.c core.h core.c
-#      $(CC) $(CF) -o test test.c core.c $(LF)
+install: cp_bin cp_www cp_conf
 
 clean:
-       $(RM) -f enhance $(C_STANDALONE) $(STANDALONE) $(TO_GENERATE) f2h $(H_PNG) $(H_SUBTOOL)
+       $(RM) -f enhance $(C_STANDALONE) $(STANDALONE) $(TO_GENERATE) f2h $(H_PNG) $(H_SUBTOOL) $(CGI) index.htm $(HTM_CGI)
 
-PHONY: all clean
+PHONY: all clean install setuid mktree cp_bin cp_www
 
 #npbd-ong1: npb npbd-ong1.cpp makefile
 #      $(CC) $(CF) -o npbd-ong1 npbd-ong1.cpp $(LF2)