# @(#)makehead.cpp version 3.151 created 4/16/96 # @(#)Copyright (c), 1987, 1996 StatSci, Inc. All rights reserved. # # For X11 compilation option settings, see the file $INC/x11.make. That # file should be included instead of cdefs.h in any Smake.cpp file that # intends to load/compile X11 programs. Some of the make variables # assigned in there are used by variables in here. (It does no harm if # x11.make isn't included because non-existent variable references expand # to empty string). # S_MAKE = $(SHOME)/cmd/MAKE tmpdir=$${TMPDIR:-/tmp} SHELL=/bin/sh SHLIBNAME=dummy.so RATFOR=$(SHOME)/cmd/ratfor CC=/opt/SUNWspro/SC3.0.1/bin/cc F2C=f2c F77=/opt/SUNWspro/SC3.0.1/bin/f77 F77COMPILE=/opt/SUNWspro/SC3.0.1/bin/f77 BIGF77=-Nq500 -Nn801 FLOAT_FLAG= DEBUG_FLAG= OPTIMIZE_FLAG=-O LDFLAGS= MD_CFLAGS= MISC_FFLAGS= MISC_LDFLAGS= CMLIB_FLAG= SYS_DEP_LIBS = LDFLAGS_DYN=$(LDFLAGS) LDFLAGS_STATIC=$(LDFLAGS) LOCAL_CFLAGS= LOCAL_FFLAGS= CFLAGS= -f DO NOT USE CFLAGS" FFLAGS= -f DO NOT USE FFLAGS" IF= -if RMAC=$I/u/mach.m $I/ratfor.m CMAC=$I/u/mach.m $I/u/cdefs.m STD_R_MFILES = $(SHOME)/newfun/include/u/mach.m \ $(SHOME)/newfun/include/ratfor.m \ $(SHOME)/newfun/include/stand.m STD_C_MFILES = $(SHOME)/newfun/include/u/mach.m \ $(SHOME)/newfun/include/u/cdefs.m # Using SunPRO acc compiler PREPROCESS_FLAG=-E -C ENV= GXARGS=gxargs DUMMY_RULE= SYM_LINK=ln -s STRIP= -s RM=/bin/rm RM_TEMPS=/bin/rm -f $(tmpdir)/$*.* RM_LOCALS=2>&1 | sed "/local variable.*used/d" M4=$C/m4 ORIG_INCDIR=`pwd` ORIG_INCFLAG=-I$$A INCLUDE_FLAG=-I$(INC) $(XINCLUDE) MISC_CFLAGS=$(X_CFLAGS) $(MD_CFLAGS) PROG=$(F77) # DEV_LD_LIBS and DEV_LDFLAGS_DYN used by $SL/Devices Smakefiles # C library must be included before Fortran library on IBM RS6000 -tpc DEV_LD_LIBS = $(F2CLIB) -lm $(SYS_DEP_LIBS) -lc # Clear this out. Dynamic loading in device drivers only done where # needed (HP800/HP700 at HPUX 8.0+) DEV_LDFLAGS_DYN=$(LDFLAGS) CC_O=$(CC) -o BIGC=C O=o FUNS_DIR=.Functions DSETS_DIR=.Datasets HELP_DIR=.Help DATA_DIR=.Data AUDIT_FILE=.Audit FOUND_FILES={} Y_TAB=y.tab A=$(SHOME)/adm/cmd C=$(SHOME)/cmd I=$(SHOME)/newfun/include INC=$(SHOME)/include QPE=$(SHOME)/src/qpe L=$(SHOME)/newfun/lib SPLUS_LIBRARY=splus.a SPLUS_DEST=$(SHOME)/splus DEST=$(SHOME)/splus INDDEV=$L/inddev.z PSL=$L/psl.a LIBR=$L/lang.a $(PSL) GRZLIB=$L/grz.a $(PSL) GRZ=$(INDDEV) $L/grz.a $L/lang.a $(PSL) # The following allows the target BIG_TARG to be used in individual # Smakefiles to create __BIG and __BIGIN in local .Data directories. # The maketail file has the bigfiles target defined. BIG_TARG=bigfiles Imac = $(SHOME)/newfun/include INCmac = $(SHOME)/include S_DOT_H = $(SHOME)/touches/S_dot_h S_DOT_H1 = $(SHOME)/touches/S_dot_h1 S_DOT_H2 = $(SHOME)/touches/S_dot_h2 # machine-dependent automatically-changed by $A/fix.makefile follows this ... # end machine-dependent stuff .SUFFIXES: .SUFFIXES: .o .f .r .c .$(BIGC) .i .x .qpp .q .dpp .d .fpp .rpp .cpp .ad .adh .adp .ci .rpc .ppc # MKS make (for DOS & Windows) fails using suffix rules (it considers them # "outdated") when the dependency has to be made. These macros are to be # used to handle the difference between suffix rules and meta rules. R_TO_O=.r.o: F_TO_O=.f.o: C_TO_O=.c.o: C_TO_CI=.c.ci: FPP_TO_F=.fpp.f: RPP_TO_R=.rpp.r: $(R_TO_O) -$(RM) -f $(tmpdir)/$*.* >/dev/null 2>&1 || true $(M4) -DSHOME=$(SHOME) -DBASEFILE=$*.r $(RMAC) $*.r >$(tmpdir)/$*.r $(RATFOR) "-6&" <$(tmpdir)/$*.r >$(tmpdir)/$*.f cd $(tmpdir); $(F77COMPILE) $(OPTIMIZE_FLAG) $(FLOAT_FLAG) $(DEBUG_FLAG) $(MISC_FFLAGS) $(LOCAL_FFLAGS) -c $*.f mv $(tmpdir)/$*.$(O) $*.o -$(RM_TEMPS) .i.x: -$(RM) -f $(tmpdir)/$*.* >/dev/null 2>&1 || true $C/icomp <$*.i >$(tmpdir)/$*.i $(M4) -DSHOME=$(SHOME) -DBASEFILE=$*.i $I/intf.m $(tmpdir)/$*.i >$(tmpdir)/$*.s $(M4) -DSHOME=$(SHOME) -DBASEFILE=$*.i $(RMAC) $(tmpdir)/$*.s >$(tmpdir)/$*.r $(RATFOR) "-6&" <$(tmpdir)/$*.r >$(tmpdir)/$*.f cd $(tmpdir); $(F77COMPILE) -c $(BIGF77) $(OPTIMIZE_FLAG) $(FLOAT_FLAG) $(DEBUG_FLAG) $(MISC_FFLAGS) $(LOCAL_FFLAGS) $*.f $(RM_LOCALS) mv $(tmpdir)/$*.$(O) $*.x -$(RM_TEMPS) $(F_TO_O) -$(RM) -f $(tmpdir)/$*.* >/dev/null 2>&1 || true cat $*.f >$(tmpdir)/$*.f cd $(tmpdir); $(F77COMPILE) $(OPTIMIZE_FLAG) $(FLOAT_FLAG) $(DEBUG_FLAG) $(MISC_FFLAGS) $(LOCAL_FFLAGS) -c $*.f mv $(tmpdir)/$*.$(O) $*.o -$(RM_TEMPS) .$(BIGC).o: -$(RM) -f $(tmpdir)/$*.c >/dev/null 2>&1 || true @echo $*.$(BIGC) $(M4) -DSHOME=$(SHOME) -DBASEFILE=$*.$(BIGC) $(CMAC) $*.$(BIGC) >$(tmpdir)/$*.c A=$(ORIG_INCDIR); cd $(tmpdir); $(CC) $(OPTIMIZE_FLAG) $(FLOAT_FLAG) $(DEBUG_FLAG) $(MISC_CFLAGS) $(LOCAL_CFLAGS) $${CPP_FLAGS} $(ORIG_INCFLAG) $(INCLUDE_FLAG) -c $*.c mv $(tmpdir)/$*.$(O) $*.o -$(RM_TEMPS) $(C_TO_O) -$(RM) -f $(tmpdir)/$*.c >/dev/null 2>&1 || true @echo $*.c cp $*.c $(tmpdir)/$*.c A=$(ORIG_INCDIR); cd $(tmpdir); $(CC) $(OPTIMIZE_FLAG) $(FLOAT_FLAG) $(DEBUG_FLAG) $(MISC_CFLAGS) $(LOCAL_CFLAGS) $${CPP_FLAGS} $(ORIG_INCFLAG) $(INCLUDE_FLAG) -c $*.c mv $(tmpdir)/$*.$(O) $*.o -$(RM_TEMPS) $(C_TO_CI) -$(RM) -f $(tmpdir)/$*.c >/dev/null 2>&1 || true @echo $*.c cp $*.c $(tmpdir)/$*.c A=$(ORIG_INCDIR); cd $(tmpdir); $(CC) $(OPTIMIZE_FLAG) $(FLOAT_FLAG) $(DEBUG_FLAG) $(MISC_CFLAGS) $(LOCAL_CFLAGS) $${CPP_FLAGS} $(ORIG_INCFLAG) $(INCLUDE_FLAG) $(PREPROCESS_FLAG) > $*.i $*.c mv $(tmpdir)/$*.i $*.ci -$(RM_TEMPS) .r.f: -$(RM) -f $(tmpdir)/$*.* >/dev/null 2>&1 || true $(M4) -DSHOME=$(SHOME) -DBASEFILE=$*.r $(RMAC) $*.r >$(tmpdir)/$*.r $(RATFOR) "-6&" <$(tmpdir)/$*.r >$(tmpdir)/$*.f .$(BIGC).c: -$(RM) -f $(tmpdir)/$*.c >/dev/null 2>&1 || true @echo $*.$(BIGC) $(M4) -DSHOME=$(SHOME) -DBASEFILE=$*.$(BIGC) $(CMAC) $*.$(BIGC) >$(tmpdir)/$*.c .cpp: @-mv -f $* $*.before $(ENV) CPP_FLAGS="-DNOT_C_SOURCE $$CPP_FLAGS $(INCLUDE_FLAG)" CPP_FILE $*.cpp > $* .qpp.q: $(ENV) CPP_FLAGS="-DNOT_C_SOURCE $$CPP_FLAGS $(INCLUDE_FLAG) -DQPE" CPP_FILE $*.qpp > $*.q .dpp.d: $(ENV) CPP_FLAGS="-DNOT_C_SOURCE $$CPP_FLAGS $(INCLUDE_FLAG) -DHELP_FILE" CPP_FILE -b $*.dpp > $*.d $(FPP_TO_F) $(ENV) CPP_FLAGS="-DNOT_C_SOURCE $$CPP_FLAGS $(INCLUDE_FLAG) -DFORTRAN" CPP_FILE $*.fpp > $*.f $(RPP_TO_R) $(ENV) CPP_FLAGS="-DNOT_C_SOURCE $$CPP_FLAGS $(INCLUDE_FLAG) -DFORTRAN" CPP_FILE $*.rpp > $*.r .adp.ad: $(ENV) CPP_FLAGS="-DNOT_C_SOURCE $$CPP_FLAGS $(INCLUDE_FLAG) -DADFILE" CPP_FILE $*.adp > $*.ad .ad.adh : $C/ad2c $*.ad > $*.adh # Right now, this rule MIGHT get used in slocal/process or in # module/dataconn. .ppc.rpc: $(ENV) CPP_FLAGS="-DNOT_C_SOURCE $$CPP_FLAGS -I. $(INCLUDE_FLAG) -DRPC_FILE" CPP_FILE -b $*.ppc > $@