Skip to content

Commit 0056329

Browse files
committed
make archive now creates tar files that unpack into a subdirectory
1 parent 7c0fce5 commit 0056329

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

Makefile

+12-2
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ clean:
3434
rm ${targets} \
3535
$(addsuffix .c, ${targets}) \
3636
bacmp \
37+
*.tar.gz \
3738
*.o *~ core \
3839
input.do output.do output.ba \
3940
2>/dev/null || true
@@ -70,6 +71,15 @@ distcheck: all
7071
# Maybe useful for copying to projects without requiring a dependency on flex.
7172
cfiles: $(addsuffix .c, ${targets})
7273

74+
# Dirname so we can create tar files that unpack into a directory
75+
thisdir := $(notdir $(shell pwd))
76+
7377
artifacts: all cfiles
74-
tar -zcf linux-amd64.tar.gz ${targets} bacmp ${scripts}
75-
tar -zcf cfiles.tar.gz $(addsuffix .c, ${targets}) m100-tokenize-main.c bacmp.c ${scripts}
78+
tar -C .. -zcf ../source.tar.gz \
79+
--exclude='*reference*' --exclude='.git*' --exclude='*.tar.gz' \
80+
${thisdir}
81+
mv ../source.tar.gz .
82+
tar -C .. -zcf linux-amd64.tar.gz \
83+
$(addprefix ${thisdir}/, ${targets} bacmp ${scripts})
84+
tar -C .. -zcf cfiles.tar.gz \
85+
$(addprefix ${thisdir}/, $(addsuffix .c, ${targets}) m100-tokenize-main.c bacmp.c ${scripts})

0 commit comments

Comments
 (0)