@@ -160,6 +160,20 @@ $(RESDIR)/CHANGES: CHANGES $(RESMKDIRSTAMP)
160160$(RESDIR ) /docs/% : $(DOCDIR ) /% $(RESMKDIRSTAMP )
161161 cp $< $@
162162
163+ # ------------------------------------------------------------
164+ #
165+ # Auto-generate atload names list for packaged resources
166+ #
167+
168+ $(DSTDIR ) /make_packaged_resource.ps : $(DSTDIR ) /make_packaged_resource.ps.template $(SOURCES )
169+ @grep -rh ' ^[^%]*//[a-z][a-z0-9-]*' $(SRCDIR ) /* .ps.src | \
170+ grep -oh ' //[a-z][a-z0-9-]*' | \
171+ sed ' s|^//||' | sort -u | tr ' \n' ' ' | \
172+ sed ' s/ $$//' | \
173+ { read names; sed " s/@@ATLOAD_NAMES@@/$$ names/" $< > $@ ; }
174+
175+ cleanlist += $(DSTDIR ) /make_packaged_resource.ps
176+
163177# ------------------------------------------------------------
164178
165179packaged_resource : $(TARGETS_PACKAGE )
@@ -168,10 +182,10 @@ $(PACKAGEMKDIRSTAMP):
168182 mkdir -p $(PACKAGEMKDIRS )
169183 touch $@
170184
171- $(PACKAGEDIR ) /Resource/uk.co.terryburton.bwipp/% : $(SRCDIR ) /% .ps.src $(SRCDIR ) /ps.head $(CHANGES_FILE ) $(PACKAGEMKDIRSTAMP )
185+ $(PACKAGEDIR ) /Resource/uk.co.terryburton.bwipp/% : $(SRCDIR ) /% .ps.src $(SRCDIR ) /ps.head $(CHANGES_FILE ) $(DSTDIR ) /make_packaged_resource.ps $( PACKAGEMKDIRSTAMP )
172186 $(DSTDIR ) /make_resource.pl $< $@
173187
174- $(PACKAGEDIR ) /Resource/Category/uk.co.terryburton.bwipp : $(SRCDIR ) /preamble.ps.src $(SRCDIR ) /ps.head $(CHANGES_FILE ) $(PACKAGEMKDIRSTAMP )
188+ $(PACKAGEDIR ) /Resource/Category/uk.co.terryburton.bwipp : $(SRCDIR ) /preamble.ps.src $(SRCDIR ) /ps.head $(CHANGES_FILE ) $(DSTDIR ) /make_packaged_resource.ps $( PACKAGEMKDIRSTAMP )
175189 $(DSTDIR ) /make_resource.pl $< $@
176190
177191$(PACKAGEDIR ) /Resource/uk.co.terryburton.bwipp.upr : $(UPR_FILE ) $(PACKAGEMKDIRSTAMP )
305319YEAR: =$(shell date +% Y)
306320
307321copyright :
308- sed -i -e ' s@\(Copyright\)\(.*\)\(2004-\)\([[:digit:]]\+\)\( Terry Burton\)@\1\2\3$(YEAR)\5@' $(SOURCES ) LICENSE Makefile $(SRCDIR ) /ps.head $(DSTDIR ) /make_packaged_resource.ps $(DSTDIR ) /make_resource.ps libs/bindings/postscriptbarcode.i libs/c/* .[ch]
322+ sed -i -e ' s@\(Copyright\)\(.*\)\(2004-\)\([[:digit:]]\+\)\( Terry Burton\)@\1\2\3$(YEAR)\5@' $(SOURCES ) LICENSE Makefile $(SRCDIR ) /ps.head $(DSTDIR ) /make_packaged_resource.ps.template $(DSTDIR ) /make_resource.ps libs/bindings/postscriptbarcode.i libs/c/* .[ch]
309323
310324whitespace :
311325 perl -p -i -e ' s/\s+$$/\n/;' $(SOURCES )
0 commit comments