1 # 2 # Neotonic Source Kit 3 # 4 # Copyright (C) 2001 Neotonic and Brandon Long 5 # 6 # 7 8 NEOTONIC_ROOT = . 9 10 include rules.mk 11 12 SUBDIRS = util cs cgi $(BUILD_WRAPPERS) 13 14 OUTDIRS = bin libs 15 16 # These are blank here... but populated under automated build 17 VERSION = 18 RELEASE = 19 20 all: cs $(BUILD_WRAPPERS) 21 22 rules.mk: configure 23 ./configure 24 25 configure: configure.in 26 ./autogen.sh 27 28 cs: output_dir 29 @for mdir in $(SUBDIRS); do \ 30 if test -d $$mdir; then \ 31 if test -f $$mdir/Makefile.PL -a ! -f $$mdir/Makefile; then \ 32 cd $$mdir; $(PERL) Makefile.PL PREFIX=$(prefix); cd ..; \ 33 fi; \ 34 $(MAKE) -C $$mdir PREFIX=$(prefix); \ 35 fi; \ 36 done 37 38 install: all 39 ./mkinstalldirs $(DESTDIR)$(cs_includedir) 40 ./mkinstalldirs $(DESTDIR)$(bindir) 41 ./mkinstalldirs $(DESTDIR)$(libdir) 42 ./mkinstalldirs $(DESTDIR)$(mandir)/man3 43 $(INSTALL) -m 644 ClearSilver.h $(DESTDIR)$(cs_includedir)/ 44 $(INSTALL) -m 644 cs_config.h $(DESTDIR)$(cs_includedir)/ 45 $(INSTALL) -m 644 man/man3/*.3 $(DESTDIR)$(mandir)/man3/ 46 @for mdir in $(SUBDIRS); do \ 47 if test -d $$mdir; then \ 48 if test -f $$mdir/Makefile.PL -a ! -f $$mdir/Makefile; then \ 49 cd $$mdir; $(PERL) Makefile.PL PREFIX=$(prefix); cd ..; \ 50 fi; \ 51 $(MAKE) -C $$mdir PREFIX=$(prefix) install; \ 52 fi; \ 53 done 54 55 depend: 56 @for mdir in $(SUBDIRS); do \ 57 if test ! -f $$mdir/Makefile.PL; then \ 58 $(MAKE) -C $$mdir depend; \ 59 fi; \ 60 done 61 62 newdepend: killdepend 63 @echo "*******************************************" 64 @echo "** Building dependencies..." 65 @for mdir in $(SUBDIRS); \ 66 do $(MAKE) -C $$mdir depend; \ 67 done 68 69 killdepend: 70 @echo "*******************************************" 71 @echo "** Removing Old dependencies..." 72 @find . -name "Makefile.depends" -print | $(XARGS) rm % 73 74 .PHONY: man 75 man: 76 @mkdir -p man/man3 77 @for mdir in $(SUBDIRS); do \ 78 scripts/document.py --owner "ClearSilver" --outdir man/man3/ $$mdir/*.h; \ 79 done 80 81 .PHONY: hdf 82 hdf: 83 @mkdir -p docs/hdf 84 @for mdir in $(SUBDIRS); do \ 85 scripts/document.py --hdf --owner "ClearSilver" --outdir docs/hdf/ $$mdir/*.h; \ 86 done 87 88 changelog: 89 p4 changes -l ./... 90 91 92 clean: 93 -@for mdir in $(SUBDIRS); do \ 94 $(MAKE) -C $$mdir clean; \ 95 done 96 97 distclean: 98 -@for mdir in $(SUBDIRS); do \ 99 $(MAKE) -C $$mdir distclean; \ 100 done 101 -@for mdir in $(OUTDIRS); do \ 102 rm -rf $$mdir/*; \ 103 done 104 rm -f config.cache config.log config.status rules.mk cs_config.h 105 rm -rf autom4te.cache 106 107 output_dir: 108 @for mdir in $(OUTDIRS); do \ 109 mkdir -p $$mdir; \ 110 done 111 112 CS_DISTDIR = clearsilver-0.10.5 113 CS_LABEL = CLEARSILVER-0_10_5 114 CS_FILES = README README.python INSTALL LICENSE CS_LICENSE rules.mk.in Makefile acconfig.h autogen.sh config.guess config.sub configure.in cs_config.h.in mkinstalldirs install-sh ClearSilver.h 115 CS_DIRS = util cs cgi python scripts mod_ecs imd java-jni perl ruby dso csharp ports contrib m4 116 117 cs_dist: 118 @if p4 labels Makefile | grep "${CS_LABEL}"; then \ 119 echo "release ${CS_LABEL} already exists"; \ 120 echo " to rebuild, type: p4 label -d ${CS_LABEL}"; \ 121 exit 1; \ 122 fi; 123 rm -rf $(CS_DISTDIR) 124 p4 label $(CS_LABEL) 125 p4 labelsync -l$(CS_LABEL) $(CS_FILES) $(addsuffix /..., $(CS_DIRS)) 126 mkdir -p $(CS_DISTDIR) 127 tar -cf - `p4 files $(CS_FILES) $(addsuffix /..., $(CS_DIRS)) | cut -d'#' -f 1 | sed -e "s|//depot/google3/third_party/clearsilver/core/||"` | (cd $(CS_DISTDIR); tar -xf -) 128 $(MAKE) -C $(CS_DISTDIR) man distclean 129 chmod -R u+w $(CS_DISTDIR) 130 chmod -R a+r $(CS_DISTDIR) 131 tar chozf $(CS_DISTDIR).tar.gz $(CS_DISTDIR) 132