Added dist target

This commit is contained in:
mainzelm 2003-05-16 18:54:00 +00:00
parent 54d94daaa2
commit 9f5b33a627
1 changed files with 32 additions and 0 deletions

View File

@ -104,6 +104,38 @@ $(SCX_IMAGE): $(SCX_VM) $(SCM_FILES) $(SCM_CONFIG_FILES)
$(SCX): $(SCX_IMAGE) main.o $(OBJECTS)
$(CC) -o $@ $(LIB_DIRS) main.o $(OBJECTS) $(LIBS)
# --------------------
# Distribution...
distdir = /tmp
# DISTFILES should include all sources.
DISTFILES = COPYRIGHT configure configure.in Makefile.in \
$(SCM_FILES) $(SCM_CONFIG_FILES) $(OBJECTS:.o=.c) \
c/main.c c/xlib/xlib.h
distname = scx-0.1
.PHONY : dist
dist:
distname=$(distname) && \
distfile=$(distdir)/$$distname.tar.gz && \
if [ -d $(distdir) ] && \
[ -w $$distfile -o -w $(distdir) ]; then \
rm -f $$distname && \
ln -s . $$distname && \
files='' && \
for i in $(DISTFILES); do \
files="$$files $$distname/$$i"; \
done && \
tar -cf - $$files | \
gzip --best >$$distfile && \
rm $$distname; \
else \
echo "Can't write $$distfile" >&2; \
exit 1; \
fi
clean:
rm -f $(SCX_VM) $(SCX) $(SCX_IMAGE) *.o c/*.o c/xlib/*.o c/libs/*.o