Skip to content

Commit 5d01f49

Browse files
committed
Packager: Create atload names automatically
1 parent 4f49111 commit 5d01f49

File tree

3 files changed

+18
-3
lines changed

3 files changed

+18
-3
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,5 @@ build/resource/
66
build/release/
77
build/standalone/
88
build/standalone_package/
9+
build/make_packaged_resource.ps
910
libs/docs/html/

Makefile

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -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

165179
packaged_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)
@@ -305,7 +319,7 @@ tag:
305319
YEAR:=$(shell date +%Y)
306320

307321
copyright:
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

310324
whitespace:
311325
perl -p -i -e 's/\s+$$/\n/;' $(SOURCES)

0 commit comments

Comments
 (0)