http://www.ibiblio.org/pub/historic-linux/ftp-archives/sunsite.unc.edu/Sep-29-1996...
[xscreensaver] / Imakefile
1 /*
2  * Imakefile file for xscreensaver, Copyright (c) 1991-1994 Jamie Zawinski.
3  *
4  * You should not need to edit this file; edit config.h instead.
5  *
6  */
7
8 #include "config.h"
9
10        TARFILES = README Imakefile config.h screenblank.txt
11             TAR = tar
12        COMPRESS = compress
13    COMPRESS_EXT = Z
14 /**/#      COMPRESS = gzip --verbose --best
15 /**/#  COMPRESS_EXT = gz
16
17 all:: utils/Makefile driver/Makefile hacks/Makefile
18         cd utils  ; $(MAKE) $@ CC="$(CC)" CCOPTIONS="$(CCOPTIONS)" CDEBUGFLAGS="$(CDEBUGFLAGS)"
19         cd driver ; $(MAKE) $@ CC="$(CC)" CCOPTIONS="$(CCOPTIONS)" CDEBUGFLAGS="$(CDEBUGFLAGS)"
20         cd hacks  ; $(MAKE) $@ CC="$(CC)" CCOPTIONS="$(CCOPTIONS)" CDEBUGFLAGS="$(CDEBUGFLAGS)"
21
22 clean install install.man:: utils/Makefile driver/Makefile hacks/Makefile
23         cd utils  ; $(MAKE) $@ BINDIR=$(BINDIR) XAPPLOADDIR=$(XAPPLOADDIR)
24         cd driver ; $(MAKE) $@ BINDIR=$(BINDIR) XAPPLOADDIR=$(XAPPLOADDIR)
25         cd hacks  ; $(MAKE) $@ BINDIR=$(BINDIR) XAPPLOADDIR=$(XAPPLOADDIR)
26
27 Makefiles:: utils/Makefile driver/Makefile hacks/Makefile
28
29 utils/Makefile: utils/Imakefile config.h
30         cd utils  ; $(IMAKE_CMD) -DTOPDIR=$(TOP) -DCURDIR=$(CURRENT_DIR)/utils
31 driver/Makefile: driver/Imakefile config.h
32         cd driver ; $(IMAKE_CMD) -DTOPDIR=$(TOP) -DCURDIR=$(CURRENT_DIR)/driver
33 hacks/Makefile: hacks/Imakefile config.h
34         cd hacks  ; $(IMAKE_CMD) -DTOPDIR=$(TOP) -DCURDIR=$(CURRENT_DIR)/hacks
35
36 /* This really makes me sick... */
37 tar: utils/Makefile driver/Makefile hacks/Makefile
38         @NAME=`sed -n                                                       \
39   's/[^0-9]*\([0-9]\.[0-9][0-9]*\).*/xscreensaver-\1/p' utils/version.h` ;  \
40   rm -f $$NAME ; ln -s . $$NAME ;                                           \
41   FILES= ;                                                                  \
42   for subdir in driver utils hacks ; do                                     \
43     cd $$subdir ;                                                           \
44     FILES="$$FILES `make echo_tarfiles                                      \
45       | grep -v '^make\['                                                   \
46       | sed \"s|^|$$subdir/|g;s| | $$subdir/|g\"                            \
47       ` ";                                                                  \
48     cd .. ; done ;                                                          \
49   echo creating tar file $${NAME}.tar.$(COMPRESS_EXT)... ;                  \
50   $(TAR) -vchf -                                                            \
51     `echo $(TARFILES) $$FILES | sed "s|^|$$NAME/|g; s| | $$NAME/|g" `       \
52    | $(COMPRESS) > $${NAME}.tar.$(COMPRESS_EXT) ;                           \
53   rm $$NAME