From dc0e03073d1abdff1034d12b82798dd0a4ac5fe4 Mon Sep 17 00:00:00 2001 From: Paul Dicker Date: Mon, 21 Apr 2025 20:14:54 +0200 Subject: [PATCH] Adjust configure and makefile for inlined-icons.c --- GNUmakefile.template | 6 +++--- configure | 11 +++++++++-- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/GNUmakefile.template b/GNUmakefile.template index dfbd7ff..99984b5 100644 --- a/GNUmakefile.template +++ b/GNUmakefile.template @@ -124,7 +124,7 @@ ${BUILDTMP}/closure.o : src/closure.c $(ICONS) # Building the dvdisaster binary -dvdisaster: $(ICONS) $(OFILES) +dvdisaster: $(OFILES) @echo "Linking : dvdisaster" @if test $(CFG_SYS_OPTIONS) == -DSYS_MINGW; \ then windres -v src/winres.rc -O coff -o ${BUILDTMP}/winres.o >/dev/null ; \ @@ -137,7 +137,7 @@ dvdisaster: $(ICONS) $(OFILES) else $(MAKE) --no-print-directory -C locale; \ fi -src/inlined-icons.c: icons/icons.gresource.xml icons/cd.svg icons/close.svg icons/create.svg icons/fix.svg icons/help.svg icons/log.svg icons/open-ecc.svg icons/open-img.svg icons/preferences.svg icons/quit.svg icons/read-symbolic.svg icons/scan.svg icons/stop.svg icons/strip.svg icons/verify.svg +$(BUILDTMP)/inlined-icons.c: icons/icons.gresource.xml icons/cd.svg icons/close.svg icons/create.svg icons/fix.svg icons/help.svg icons/log.svg icons/open-ecc.svg icons/open-img.svg icons/preferences.svg icons/quit.svg icons/read-symbolic.svg icons/scan.svg icons/stop.svg icons/strip.svg icons/verify.svg @echo "Generating:" $(ICONS) glib-compile-resources --generate-source --target=$(ICONS) --sourcedir=icons icons/icons.gresource.xml @@ -335,7 +335,7 @@ distclean: clean clean: @echo "Removing rebuildable files" @rm -f *.o "$(BUILDTMP)"/*.o medium.* abbild.* dvdisaster .dvdisaster core core.* *.core - @rm -f src/inlined-icons.h src/help-dialogs.h + @rm -f "$(BUILDTMP)"/inlined-icons.c src/help-dialogs.h @find . -name \*\~ -print | xargs rm -f; @find . -name \*.mo -print | xargs rm -f; @find . -name \#\*\# -print | xargs rm -f; diff --git a/configure b/configure index e2335b7..ed5362b 100755 --- a/configure +++ b/configure @@ -222,7 +222,14 @@ rm -f src/conftest.c src/method-link.c cfiles="src/method-link.c" ofiles="$BUILDTMP/method-link.o" -for cfile in src/*.c; do +# Only include icons in GUI builds +if test "$cfg_with_gui" == "yes"; then + icons="$BUILDTMP/inlined-icons.c" +else + icons="" +fi + +for cfile in $icons src/*.c; do cfile_prefix=`echo $cfile | sed -e 's/\.c//'` cfiles="$cfiles $cfile" ofiles="$ofiles $BUILDTMP/$(basename $cfile_prefix.o)" @@ -233,7 +240,7 @@ echo echo -e "\nCFG_CFILES = $cfiles" >> Makefile.config echo "CFG_OFILES = $ofiles" >> Makefile.config if test "$cfg_with_gui" == "yes"; then - echo "ICONS = src/inlined-icons.c" >> Makefile.config + echo "ICONS = $icons" >> Makefile.config fi # Create the method wrapper