Skip to content

Commit 1e9860f

Browse files
committed
OS independent .tar.gz files for 'make artifacts'
1 parent 80269df commit 1e9860f

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

Makefile

+12-5
Original file line numberDiff line numberDiff line change
@@ -115,15 +115,22 @@ test-m100-crunch: m100-crunch
115115
# Maybe useful for copying to projects without requiring a dependency on flex.
116116
cfiles: $(addsuffix .c, ${targets})
117117

118-
# Dirname so we can create tar files that unpack into a directory
118+
119+
####
120+
# thisdir, used to create tar files that unpack into a directory
119121
thisdir := $(notdir $(shell pwd))
122+
xform := --xform "s%^%${thisdir}/%"
123+
# platform, specify the machine os and architecture in the .tar.gz filename
124+
platform := $(shell uname -s)-$(shell uname -m)
120125

121126
artifacts: all cfiles
122127
tar -C .. -zcf ../tokenize-source.tar.gz \
123128
--exclude='*reference*' --exclude='.git*' --exclude='*.tar.gz' \
124129
${thisdir}
125130
mv ../tokenize-source.tar.gz .
126-
tar -C .. -zcf tokenize-linux-amd64.tar.gz \
127-
$(addprefix ${thisdir}/, ${targets} bacmp ${scripts})
128-
tar -C .. -zcf tokenize-cfiles.tar.gz \
129-
$(addprefix ${thisdir}/, $(addsuffix .c, ${targets}) m100-tokenize-main.c bacmp.c ${scripts})
131+
tar ${xform} -acf tokenize-${platform}.tar.gz \
132+
${targets} ${scripts} bacmp
133+
tar ${xform} -acf tokenize-cfiles.tar.gz \
134+
$(addsuffix .c, ${targets}) \
135+
m100-tokenize-main.c bacmp.c \
136+
${scripts}

0 commit comments

Comments
 (0)