XCOMM ######################################################################### XCOMM # XCOMM # SAO Software R&D source directory XCOMM # Eric Mandel, 2/27/98 XCOMM # XCOMM ######################################################################### #include "./config/Imake.rules" #define IHaveSubdirs XCOMM #define PassCDebugFlags 'CDEBUGFLAGS=$(CDEBUGFLAGS)' #define PassCDebugFlags 'CDEBUGFLAGS=-g' LIBS = Mem Util NaN Param XPA Xkib fitsy Filter x11iraf SDIRS = Scales histeq wcssubs SAOtng Files FitsTo PROGS = Dir XDir XText XQuery Access scripts ADIRS = WWW PE AG HDB Examples ttysize SUBDIRS = $(LIBS) $(SDIRS) $(PROGS) $(ADIRS) MakeSubdirs($(SUBDIRS)) MakeLintSubdirs($(LNINSTALLDIRS),install.ln,install.ln) DependSubdirs($(SUBDIRS)) XCOMM ######################################################################### XCOMM # XCOMM # The following are the big guns for user builds ... XCOMM # XCOMM ######################################################################### World:: @echo "" @echo "Building the SAO R&D software tree ..." @echo "" @date @echo "" $(MAKE) $(MFLAGS) arch $(MAKE) $(MFLAGS) Makefiles $(MAKE) $(MFLAGS) clean $(MAKE) $(MFLAGS) depend $(MAKE) $(MFLAGS) $(WORLDOPTS) @echo "" @date @echo "" @echo "Build of SAO R&D software directory complete" @echo "" Binary: @echo "" @echo "Configuring the Binary SAO R&D software tree ..." @echo "" @date @echo "" @./getarch -link make reroot @echo "" @date @echo "" @echo "Configuration of Binary SAO R&D software directory complete" @echo "" XCOMM ######################################################################### XCOMM # XCOMM # The following sometimes are useful to users ... but not often ... XCOMM # XCOMM ######################################################################### arch: @(./getarch -bin; $(MAKE) links; $(MAKE) owcheck) showarch: @(echo "Current architecture: `./getarch`"; $(MAKE) owcheck) assist:: $(MAKE) arch $(MAKE) $(MFLAGS) all "SUBDIRS= $(LIBS) $(ADIRS) $(PROGS)" assistclean:: $(MAKE) $(MFLAGS) clean "SUBDIRS= $(LIBS) $(ADIRS) $(PROGS)" assistinstall:: $(MAKE) arch $(MAKE) $(MFLAGS) install "SUBDIRS= $(LIBS) $(ADIRS) $(PROGS)" saotng:: $(MAKE) arch $(MAKE) $(MFLAGS) all "SUBDIRS= $(LIBS) $(SDIRS) $(PROGS)" saotngclean:: $(MAKE) $(MFLAGS) clean "SUBDIRS= $(LIBS) $(SDIRS) $(PROGS)" saotnginstall:: $(MAKE) arch $(MAKE) $(MFLAGS) install "SUBDIRS= $(LIBS) $(SDIRS) $(PROGS)" stripall:: $(MAKE) strip -@($(RM) -r -f $(SUBDIRS); echo "saord source files have been deleted") chmod: find . \( -name "*.c" -o -name "*.h" \) -exec chmod 664 {} \; XCOMM ######################################################################### XCOMM # XCOMM # The following are useful only to the SAO R&D development effort XCOMM # XCOMM ######################################################################### RELEASE = `cat ./saord/VERSION` ZTARFILE= /proj/rd/FTP/saord-$(RELEASE).tar.Z GTARFILE= /proj/rd/FTP/saord-$(RELEASE).tar.gz BZTARFILE= saord-$(RELEASE)-`./saord/getarch`.tar.Z BGTARFILE= saord-$(RELEASE)-`./saord/getarch`.tar.gz BD_DIRS = saord/Doc saord/PFILES saord/Help saord/app-defaults \ saord/Colormaps saord/AGNodes saord/config saord/scripts \ saord/bin.`saord/getarch` saord/lib.`saord/getarch` saord/include BD_FILES = saord/VERSION saord/README saord/getarch saord/pathname \ saord/Imakefile saord/Makefile IRAF_FILES = saord/bin.`saord/getarch`/clvars \ saord/bin.`saord/getarch`/ncl.e \ saord/bin.`saord/getarch`/x_fmgr.e \ saord/bin.`saord/getarch`/x_hdb.e \ saord/bin.`saord/getarch`/irafmux XCOMM Define SAOSTATIC so that X libraries will be linked statically static: @(cmd="`xmkmf|grep imake` -DSAOSTATIC=1"; echo $${cmd}; $${cmd}) fast: xmkmf $(MAKE) arch $(MAKE) Makefiles "SUBDIRS=SAOtng" $(MAKE) depend "SUBDIRS=SAOtng" $(MAKE) clean "SUBDIRS=SAOtng" $(MAKE) $(MFLAGS) "SUBDIRS=SAOtng" tar: (cd ..; tar cf - saord | (cd /jaz; tar xfB -)) untar: (cd /jaz; tar cf - saord | (cd /proj/rd/eric; tar xfB -)) old: (cd ..; mv old-saord foo; mv saord old-saord; rm -r -f foo &) release: @(cd ..; \ echo " "; \ echo "Creating release tar file: $(GTARFILE) ..."; \ tar cf - saord | gzip > $(GTARFILE); \ echo "Creating release tar file: $(ZTARFILE) ..."; \ tar cf - saord | compress > $(ZTARFILE); \ echo "... done!") relclean: $(RM) XPA *.log *.install ASSISTHelp SAOtng/crunch.gui; \ $(MAKE) $(MFLAGS) clean; \ $(MAKE) $(MFLAGS) junkclean; \ mkpkg clean; junkclean: @(find . \( -name "*~" -o -name "*.bak" -o -name "*.fits" -o -name "*.reg" -o -name "foo*" \) -exec rm {} \;) #if defined(SGIArchitecture) bindist: @($(MAKE) crunch; \ cd .. ; \ echo "Creating binary release tar file: $(BGTARFILE) ..."; \ tar cfh - $(BD_DIRS) $(BD_FILES) | gzip > $(BGTARFILE); \ echo "Creating binary release tar file: $(BZTARFILE) ..."; \ tar cfh - $(BD_DIRS) $(BD_FILES) | compress > $(BZTARFILE)) #else bindist: @(cd .. ; \ echo "Creating binary release tar file $(BGTARFILE) ..."; \ tar cfh - $(BD_DIRS) $(BD_FILES) | gzip > $(BGTARFILE); \ echo "Creating binary release tar file $(BZTARFILE) ..."; \ tar cfh - $(BD_DIRS) $(BD_FILES) | compress > $(BZTARFILE)) #endif xpa1: @(echo "Setting up to use xpa version 1.0"; \ touch xpa1; \ $(RM) ./XPA; $(LN) xpa-1.0 XPA) xpa2: @(echo "Setting up to use xpa version 2.0"; \ $(RM) xpa1; \ $(RM) ./XPA; $(LN) xpa-2.0 XPA; \ $(RM) ./include/xpa.h; $(LN) `pwd`/XPA/xpa.h ./include/xpa.h; \ $(RM) ./include/prsetup.h; $(LN) `pwd`/XPA/prsetup.h ./include/prsetup.h) links: @(\ echo "Creating links for SAORD directory tree ..."; \ $(MKDIRHIER) ./include; \ if [ ! -f xpa1 ]; then make xpa2; fi; \ cd ./include; \ $(RM) ./parameter.h; $(LN) ../Param/parameter.h .; \ $(RM) ./parambind.h; $(LN) ../Param/parambind.h .; \ $(RM) ./HTML.h; $(LN) ../WWW/libhtmlw/HTML.h .; \ $(RM) ./Os.h; $(LN) ../Util/Os.h .; \ $(RM) ./PButton.h; $(LN) ../Util/PButton.h .; \ $(RM) ./NaN.h; $(LN) ../NaN/NaN.h .; \ cd ..; \ cd ./Files/iraf; \ $(RM) ./wfits.com; $(LN) ./fits/wfits.com .; \ $(RM) ./wfits.h; $(LN) ./fits/wfits.h .; \ cd ../..; \ cd ./x11iraf/; \ $(MKDIRHIER) ./include; \ cd ./include; \ $(RM) ./Obm.h; $(LN) ../obm/Obm.h .; \ $(RM) ./ObmP.h; $(LN) ../obm/ObmP.h .; \ $(RM) ./ObmW; $(LN) ../obm/ObmW .; \ $(RM) ./HTML.h; $(LN) ../obm/ObmW/HTML.h .; \ $(RM) ./Tcl; $(LN) ../obm/Tcl .; \ $(RM) ./xpm.h; $(LN) ../xpm/xpm.h .; \ $(RM) ./xpmP.h; $(LN) ../xpm/xpmP.h .; \ $(MKDIRHIER) ./X11; \ cd ./X11; \ $(RM) ./xpm.h; $(LN) ../../xpm/xpm.h .; \ $(RM) ./xpmP.h; $(LN) ../../xpm/xpmP.h .; \ cd ..; \ cd ..; \ cd ..; \ ) reroot: @( \ if [ "x$${SAORD_ROOT}" = "x" ] ; then \ SAORD_ROOT=`pwd`; \ echo "Setting SAORD_ROOT to: $${SAORD_ROOT}"; \ else \ echo "Using SAORD_ROOT from user environment: $${SAORD_ROOT}"; \ fi; \ if [ ! -f xpa1 ] ; then \ XPA_VERSION=1; \ else \ XPA_VERSION=2; \ fi; \ cd bin.`./getarch`; \ for FILE in `find . -size -50 -type f -exec grep -l "^[ \t]*setenv SAORD_ROOT" {} \;`;\ do \ ./reroot $$FILE $$SAORD_ROOT; \ done) crunch: @(echo "Making crunch.gui ..."; \ cd SAOtng; $(MAKE) crunch.gui; cp -p crunch.gui ../bin; cd ..) strip:: -@(cd bin; strip * >/dev/null 2>&1; echo "saord has been stripped") grep: -@(egrep -i error `./getarch`.log | egrep -v cc | egrep -v "^ar" | egrep -v a.out | egrep -v makedepend) #if FixOpenWindows owcheck: -@(if [ -f Makefile ]; then \ if (egrep "PROJECTROOT.*=" Makefile | egrep -v egrep | egrep -i openwin > /dev/null); then \ echo " "; \ echo "OpenWindows detected ... fixes made to imake."; \ echo " "; \ else \ echo " "; \ echo "OpenWindows not detected but imake fixes in place."; \ echo "You are unlikely to get good results ..."; \ echo " "; \ fi; \ fi) #else owcheck: -@(if [ -f Makefile ]; then \ if (egrep "PROJECTROOT.*=" Makefile | egrep -v egrep | egrep -i openwin > /dev/null); then \ echo " "; \ echo "OpenWindows detected but no fixes made to imake."; \ echo "You are unlikely to get good results ..."; \ echo " "; \ fi; \ fi) #endif missing: (rm -f /proj/rd/eric/missing.log ; \ find . -exec /proj/rd/eric/checkfile {} \;)