L_IL =-lIL
L_CGI=-lcgi
+RM =/usr/bin/rm
+
+STANDALONE=\
+nofading\
+info
+
+C_STANDALONE=\
+standalone-nofading.c\
+standalone-info.c
+
#all: 403 npb npbd npb-ong1 npbd-ong1 bluenh bluenhd insert extract seediff insertframe mremapt-1 compare nofading nofadingd
-all: enhance
+all: enhance $(STANDALONE)
makefile: makefile.1.mak $(CONFIGFILE)
enhance: enhance.c core.h core.c nofading.h nofading.c info.h info.c
$(CC) $(CF) -o enhance enhance.c core.c nofading.c info.c $(L_IL)
+$(STANDALONE): %: standalone-%.c %.c %.h core.c core.h
+ $(CC) $(CF) -o $@ standalone-$*.c $*.c core.c $(L_IL)
+
+$(C_STANDALONE): standalone-%.c: settings-standalone.txt standalone.c
+ $(CONFIGURE) subtool=$* settings-standalone.txt --in standalone.c --out $@
+
+
#test: test.c core.h core.c
# $(CC) $(CF) -o test test.c core.c $(LF)
clean:
- rm enhance
+ $(RM) -f enhance $(C_STANDALONE) $(STANDALONE)
PHONY: all clean
###MAKE_L_IL: L_IL=-lIL
###MAKE_L_CGI: L_CGI=-lcgi
+###MAKE_RM: RM = rm
+
+STANDALONE=\
+nofading\
+info
+
+C_STANDALONE=\
+standalone-nofading.c\
+standalone-info.c
+
#all: 403 npb npbd npb-ong1 npbd-ong1 bluenh bluenhd insert extract seediff insertframe mremapt-1 compare nofading nofadingd
-all: enhance
+all: enhance $(STANDALONE)
makefile: makefile.1.mak $(CONFIGFILE)
enhance: enhance.c core.h core.c nofading.h nofading.c info.h info.c
$(CC) $(CF) -o enhance enhance.c core.c nofading.c info.c $(L_IL)
+$(STANDALONE): %: standalone-%.c %.c %.h core.c core.h
+ $(CC) $(CF) -o $@ standalone-$*.c $*.c core.c $(L_IL)
+
+$(C_STANDALONE): standalone-%.c: settings-standalone.txt standalone.c
+ $(CONFIGURE) subtool=$* settings-standalone.txt --in standalone.c --out $@
+
+
#test: test.c core.h core.c
# $(CC) $(CF) -o test test.c core.c $(LF)
clean:
- rm enhance
+ $(RM) -f enhance $(C_STANDALONE) $(STANDALONE)
PHONY: all clean
int find_fading_range (ILuint n, struct PixelInfo *p, void *data);
int enhance_fading (ILuint n, struct PixelInfo *p, void *data);
-int main_nofading (int argc, char **argv)
-{
- int r;
- char *error_text = NO_STR;
-
- r = init();
- if (r!=0)
- finish(r, INIT_FAILED);
-
- r = subtool_nofading(argc, argv, 1, &error_text);
-
- if (r!=0)
- finish(r, error_text);
-
- finish(0, "");
-}
-
int subtool_nofading (int argc, char **argv, int argi, char **err)
{
uint_fast16_t frame_t = 0;
configure: /botm/bin/config/configure.pl
+rm: /usr/bin/rm
+
CC: gcc
CF: -g -Wall
L_IL: -lIL
--- /dev/null
+# settings-standalone.txt
+# 12.11.2022
+#
+# Copyright (C) 2022 Balthasar Szczepański
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+_C_DEFINE: #define $0 $1
+_C_DEFINE_STR: #define $0 "@_ESCAPE($1)"
+_C_INCLUDE_STR: #include "@_ESCAPE($0)"
+
+C_STANDALONE_INCLUDE = @_C_INCLUDE_STR($subtool\.h)
+C_STANDALONE_SUBTOOL = @_C_DEFINE(SUBTOOL, subtool_$subtool)
-# setting.txt
+# settings.txt
# 12.11.2022
#
# Copyright (C) 2022 Balthasar Szczepański
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
+_C_DEFINE_STR: #define $0 "@_ESCAPE($1)"
+# _C_INCLUDE_STR: #include "@_ESCAPE($0)"
+
MAKE_CONFIGURE = CONFIGURE = $configure
MAKE_TARGET = TARGET = $target
+MAKE_RM = RM =$rm
+
+
MAKE_CC = CC =$CC
MAKE_CF = CF =$CF
MAKE_L_IL = L_IL =$L_IL
--- /dev/null
+/*
+standalone.c
+general main wrapper for the subtools
+12.11.2022
+
+Copyright (C) 2022 Balthasar Szczepański
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU Affero General Public License as
+published by the Free Software Foundation, either version 3 of the
+License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU Affero General Public License for more details.
+
+You should have received a copy of the GNU Affero General Public License
+along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+*/
+
+#include "core.h"
+// ###C_STANDALONE_INCLUDE: #include "TOOL_NAME.h"
+
+// ###C_STANDALONE_SUBTOOL: #define SUBTOOL "subtool_TOOL_NAME"
+
+int main (int argc, char **argv)
+{
+ int r;
+ char *error_text = NO_STR;
+
+ r = init();
+ if (r!=0)
+ finish(r, INIT_FAILED);
+
+ r = SUBTOOL(argc, argv, 1, &error_text);
+
+ if (r!=0)
+ finish(r, error_text);
+
+ finish(0, "");
+}