Added dist target
This commit is contained in:
parent
54d94daaa2
commit
9f5b33a627
32
Makefile.in
32
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
|
||||
|
||||
|
|
Loading…
Reference in New Issue