summaryrefslogtreecommitdiffstats
path: root/hacks/images/Makefile
diff options
context:
space:
mode:
authorSimon Rettberg2021-04-06 14:23:46 +0200
committerSimon Rettberg2021-04-06 14:23:46 +0200
commit26b6e4255d4b9ff79a6dca10de5bec7bfc8691f9 (patch)
treea51e1637554bcd84e63cccb1cb220c898a2c4ee8 /hacks/images/Makefile
parent5.44 (diff)
downloadxscreensaver-26b6e4255d4b9ff79a6dca10de5bec7bfc8691f9.tar.gz
xscreensaver-26b6e4255d4b9ff79a6dca10de5bec7bfc8691f9.tar.xz
xscreensaver-26b6e4255d4b9ff79a6dca10de5bec7bfc8691f9.zip
xscreensaver 6.00
Diffstat (limited to 'hacks/images/Makefile')
-rw-r--r--hacks/images/Makefile43
1 files changed, 25 insertions, 18 deletions
diff --git a/hacks/images/Makefile b/hacks/images/Makefile
index 4b0a239..46aa4dc 100644
--- a/hacks/images/Makefile
+++ b/hacks/images/Makefile
@@ -1,10 +1,8 @@
-# hacks/images/Makefile.in --- xscreensaver, Copyright (c) 2018 Jamie Zawinski.
+# hacks/images/Makefile.in --- xscreensaver, Copyright © 2018-2021 Jamie Zawinski.
# the `../configure' script generates `hacks/images/Makefile' from this file.
srcdir = .
-VPATH = ${srcdir} ${srcdir}/bubbles ${srcdir}/m6502 \
- ${srcdir}/molecules ${srcdir}/noseguy
top_srcdir = ../..
UTILS_SRC = $(top_srcdir)/utils
RM = rm -f
@@ -20,29 +18,38 @@ TARFILES = Makefile \
$(STAR)/$(STAR).pov \
$(STAR)/$(STAR).txt \
-PNG_HDRS = $(shell find $(srcdir) -name \*.png | \
- sed 's@^.*/\(.*\)\.\(png\)$$@gen/\1_\2.h@')
-
default: all
-all: gen $(PNG_HDRS)
-
-gen:
- mkdir gen
-
-# %.png dependency below works because VPATH contains subdirs
-# of 'images' dir not only 'images' itself
-gen/%_png.h: %.png
- echo $(UTILS_SRC)/bin2c "$<" "$@"
- $(UTILS_SRC)/bin2c "$<" "$@"
+all: _gen
+
+_gen:
+ @\
+ DIR="gen" ; \
+ if ! [ -d "$$DIR" ]; then \
+ echo mkdir "$$DIR" ; \
+ mkdir "$$DIR" ; \
+ fi ; \
+ \
+ for png in $$(find $(srcdir) -name \*.png); do \
+ h="$${png%.png}"; \
+ h="$${h##*/}"; \
+ h="$$DIR/$${h}_png.h"; \
+ if [ ! -f "$$h" -o "$$png" -nt "$$h" ] ; then \
+ echo $(UTILS_SRC)/bin2c "$$png" "$$h"; \
+ $(UTILS_SRC)/bin2c "$$png" "$$h"; \
+ fi ; \
+ done
clean:
$(RM) -r gen
+# Note: don't remove the generated Makefile. We include that in the tar file
+# so that OSX and Android can run 'make' in this directory without 'configure'.
distclean:: clean
+ -rm -f TAGS *~ "#"*
-echo_tarfiles:
- @echo $(TARFILES)
+list_tarfiles:
+ @find $(TARFILES) -type f -print | sort
install:
install-program: