From 9f5b33a6274b35d3b4f393baaaa44802e5b33efa Mon Sep 17 00:00:00 2001 From: mainzelm Date: Fri, 16 May 2003 18:54:00 +0000 Subject: [PATCH] Added dist target --- Makefile.in | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/Makefile.in b/Makefile.in index 8ac0edf..d9f24f9 100644 --- a/Makefile.in +++ b/Makefile.in @@ -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