#define XCOMM # #define _POUND_ # _POUND_ $Id: imake.tmpl,v 1.113.2.2 2006/10/06 22:33:17 yuri Exp $ _POUND_================================================== _POUND_ Copyright IBM 1993 _POUND_================================================== _POUND_################################################## _POUND_ This makefile is automatically generated by _POUND_ imake... do not modify or you may lose your _POUND_ changes when imake generates makefiles again. _POUND_ Ignore this message if you are not using imake. _POUND_################################################## /* On Linux, the imake that comes with X11 defines "linux" to be "1". This causes problems because the word "linux" appears in several directory names (e.g., /usr/include/linux, ts/kernext/gpl-linux). If "linux" is defined, undefine it and define "LINUX_IMAKE" instead. */ #ifdef linux #undef linux #define LINUX_IMAKE 1 #endif RESOLVLIB = DESTDIR = $(SHARKCLONEROOT) TOOLDIR = /local/bin SHELL = /bin/sh CSHELL = /bin/csh #ifdef LINUX_IMAKE IMAKE = /usr/X11R6/bin/imake CC=g++ C_COMP=gcc /* CC = egcs */ /* C_COMP = egcs */ INSTALL = /usr/bin/install AR = ar clq BARELD = ld KAR = ld $(LDFLAGS2) -r -o ARDEL = ar d MAKEDEPEND = g++ CPLUSINC = #else /* LINUX_IMAKE */ IMAKE = $(TOOLDIR)/imake CC = xlC_r C_COMP = cc_r INSTALL = /usr/ucb/install AR = ar -clq KAR = $(AR) ARDEL = ar -d MAKEDEPEND = xlC_r CPLUSINC = -I/usr/lpp/xlC/include #endif LD = $(CC) CDEBUGFLAGS = NATIVE_CC=$(CC) NATIVE_C_COMP=$(C_COMP) NATIVE_LD=$(NATIVE_CC) /* Default flags for supplemental patches that must be applied to select portions of the code, which are not part of the standard kernel patching. These flags can be modified in individual Imakefiles if multiple supplemental patches are required (by setting flags *before* ObjectRule). */ PATCHED_KERNEL_FLAGS = /* Default location for cxi header files */ CXI_HEADER_DIR = $(DESTDIR)/include #ifdef LINUX_IMAKE /* For Linux we want cxi headers separated from proprietary headers */ CXI_HEADER_DIR = $(DESTDIR)/include/cxi #endif /* LINUX_IMAKE */ SOURCE_CONTROL = cvs SRC_UPDATE_CMD = $(SOURCE_CONTROL) update -d SRC_CHECKIN_CMD = $(SOURCE_CONTROL) ci -a DEPENDSCRIPT = $(DESTDIR)/bin/depend.sh PATCHSCRIPT = $(DESTDIR)/bin/applypatch.sh IMAKE_DEFINES = IRULESRC = $(DESTDIR)/shark/config NIDLFLAGS = -exts C.c,S.c,W.c NIDLINCLUDES = $(LOCALNIDLINCLUDES) LINTOPTS = -axz LINTLIBFLAG = -C #ifdef LINUX_IMAKE STD_CFLAGS = STD_LDFLAGS = STD_INCLUDES = -I$(DESTDIR)/include -I$(CXI_HEADER_DIR) ARFLAGS = KARFLAGS = STD_LDFLAGS = $(EXTRASTD_LDFLAGS) LDFLAGS2 = $(EXTRALDFLAGS2) #else STD_CFLAGS = -qtbtable=full -qinfo=gen:ret:uni:ini $(EXTRASTD_CFLAGS) STD_LDFLAGS = -qtwolink $(EXTRASTD_LDFLAGS) STD_INCLUDES = -I$(DESTDIR)/include -I$(CXI_HEADER_DIR) LDFLAGS2 = $(EXTRALDFLAGS2) ARFLAGS = $(EXTRAARFLAGS) KARFLAGS = $(EXTRAARFLAGS) M4FLAGS = $(EXTRAM4FLAGS) ASFLAGS = $(EXTRAASFLAGS) CFLAGS32 = -q32 CFLAGS64 = -q64 -qlargetype #endif STD_KINCLUDES = $(STD_INCLUDES) AS = as CPP = /lib/cpp LINT = lint RM = rm -f MV = mv CP = cp LN = ln -s RANLIB = ranlib RPM = rpm RPMBUILD = /usr/bin/rpmbuild LS = ls AWK = awk SORT = sort TR = tr MAKE = /usr/bin/make MAKEDASH = - /* Override above to empty for gnumake */ SED = sed LEX = lex YACC = yacc BISON = bison NIDL = /etc/ncs/nidl $(NIDLFLAGS) MKTRACE = $(DESTDIR)/bin/mktrace MERGETRC = $(DESTDIR)/bin/mergetrc MKTRCFMT = $(DESTDIR)/bin/mktrcfmt MKRPC = $(DESTDIR)/bin/mkrpc CHKSYSTYPES = $(SHARKCLONEROOT)/../tools/chksystypes _POUND_ Ship values LPP_NAME=mmfs LOCAL_PROD_NAME = mmfs SHIP_TYPE = FILE SHIP_OWNER = bin SHIP_GROUP = system SHIP_CLASS = apply SHIP_ROOT = $(SHARKCLONEROOT)/ship SHIPDIR = $(SHIP_ROOT)/usr/lpp/$(LPP_NAME) SHIP_CMD = /usr/ucb/install -c _POUND_################################################## _POUND_ The following comes from the site.mcr _POUND_################################################## #include _POUND_################################################## _POUND_ Back from site.mcr _POUND_################################################## .SUFFIXES: .o .32o .64o .C .c .s .spp .y .l .idl .sh .ko .spec .po .pko .rpc ALL_INCLUDES = -I. $(IMAKE_INCLUDES) $(STD_INCLUDES) ALL_KINCLUDES = -I. $(IMAKE_INCLUDES) $(STD_KINCLUDES) ALL_LIBPATHS = -L. $(IMAKE_LIBS) IMAKE_CMD = $(IMAKE) -Timake.tmpl -I. -I$(IRULESRC) -s makefile DOTDOTIMAKE_CMD = $(IMAKE) -Timake.tmpl -I. -I$(IRULESRC) -s makefile ALL_DEFINES = $(IMAKE_DEFINES) $(SITE_DEFINES) $(SITE_FAR_TRACE_OPTS) $(IMAKE_DEFINES_LAST) ALL_KDEFINES = $(IMAKE_DEFINES) $(SITE_DEFINES) $(SITE_OTHER_KDEFINES) $(SITE_KFAR_TRACE_OPTS) CFLAGS = $(OPTFLAGS) $(STD_CFLAGS) $(IMAKE_CFLAGS) $(CDEBUGFLAGS) $(ALL_INCLUDES) $(ALL_DEFINES) NATIVECFLAGS = -O $(STD_CFLAGS) $(IMAKE_CFLAGS) $(CDEBUGFLAGS) $(ALL_INCLUDES) $(ALL_DEFINES) KCFLAGS = $(KOPTFLAGS) $(STD_CFLAGS) $(IMAKE_CFLAGS) $(CDEBUGFLAGS) $(ALL_KINCLUDES) $(ALL_KDEFINES) TESTING_CFLAGS = -DTESTINGONLYTESTING $(CFLAGS) /* ***************************************************************** *\ * shark.rls - macro (rules) for Imakefiles \* ***************************************************************** */ /* ***************************************************************** *\ * Standard Compilation Rules \* ***************************************************************** */ /*************************************************** * Export: * AppendFiles() * CleanTarget() * CppAndFilter() * DependTarget() * SharedObjectTarget() * LibraryTarget() * MkdirTarget() * NormalAsmPPRule() * NormalAsmRule() * NormalLexRule() * NativeObjectRule() * NormalObjectRule() * SharedObjectRule(shflags) * NormalYaccRule() * NidlTarget() * NativeProgramTarget() * ProgramTarget() * CProgramTarget() * TestProgramTarget() * TestingOnlyTestingRule() * MsgTarget() ***************************************************/ /* Linux hack to reset header include search paths for portability layer so that we only try to include portability and cxi header files from GPFS */ #ifdef GPFS_LINUX GPL_HEADER_DIR = $(DESTDIR)/include/gpl-linux GPL_LIB_DIR = $(DESTDIR)/lib/gpl-linux #define SetGplIncludePath() @@\ STD_KINCLUDES = -I$(CXI_HEADER_DIR) -I$(GPL_HEADER_DIR) -I$(KERNEL_HEADER_DIR) /* Try to catch dumb mistakes in building portability layer. Skip the check if LINUX_SKIP_DIST_CHECK is defined. */ #define CheckLinuxDistribution() #ifndef LINUX_SKIP_DIST_CHECK Headers:: @@\ @if [ "$(LINUX_DISTRIBUTION)" = "REDHAT_LINUX" ]; then \ @@\ if [ ! -f /etc/redhat-release ]; then \ @@\ echo "Error: the current Linux environment does not agree with the setting, LINUX_DISTRIBUTION = $(LINUX_DISTRIBUTION), specified in site.mcr!"; exit 1; \ @@\ else \ @@\ rhreltype=`awk '/Enterprise/ {print "Enterprise"}' /etc/redhat-release`; \ @@\ if [ "$$rhreltype" = "Enterprise" ]; then \ @@\ echo "Error: the current Linux environment appears to be RedHat Enterprise Linux, which requires setting LINUX_DISTRIBUTION = REDHAT_AS_LINUX in site.mcr!"; exit 1; \ @@\ fi; \ @@\ fi; \ @@\ elif [ "$(LINUX_DISTRIBUTION)" = "REDHAT_AS_LINUX" ]; then \ @@\ if [ ! -f /etc/redhat-release ]; then \ @@\ echo "Error: the current Linux environment does not agree with the setting, LINUX_DISTRIBUTION = $(LINUX_DISTRIBUTION), specified in site.mcr!"; exit 1; \ @@\ else \ @@\ rhreltype=`awk '/Enterprise/ {print "Enterprise"}' /etc/redhat-release`; \ @@\ if [ "$$rhreltype" != "Enterprise" ]; then \ @@\ echo "Error: the current Linux environment appears to be RedHat Linux (not Enterprise Linux [AS|ES|WS] version), which requires setting LINUX_DISTRIBUTION = REDHAT_LINUX in site.mcr!"; exit 1; \ @@\ fi; \ @@\ fi; \ @@\ elif [ "$(LINUX_DISTRIBUTION)" = "SUSE_LINUX" ]; then \ @@\ if [ ! -f /etc/SuSE-release ]; then \ @@\ echo "Error: the current Linux environment does not agree with the setting, LINUX_DISTRIBUTION = $(LINUX_DISTRIBUTION), specified in site.mcr!"; exit 1; \ @@\ fi; \ @@\ elif [ "$(LINUX_DISTRIBUTION)" = "KERNEL_ORG_LINUX" ]; then \ @@\ echo "This is OK" > /dev/null; \ @@\ else \ @@\ echo "Error: LINUX_DISTRIBUTION = '$(LINUX_DISTRIBUTION)' is not a valid choice in site.mcr!"; exit 1; \ @@\ fi; #endif /* LINUX_SKIP_DIST_CHECK */ #endif /* GPFS_LINUX */ #define NativeObjectRule() @@\ .C.o: @@\ $(RM) $@ @@\ $(NATIVE_CC) -c $(NATIVECFLAGS) $*.C @@\ .c.o: @@\ $(RM) $@ @@\ $(NATIVE_C_COMP) -c $(NATIVECFLAGS) $*.c #define LinuxKernelObjectRule() @@\ .c.ko: @@\ $(RM) $@ @@\ $(C_COMP) -o $@ -c $(KCFLAGS) $*.c #define NormalObjectRule() @@\ .C.o: @@\ $(RM) $@ @@\ $(CC) -c $(CFLAGS) $*.C @@\ .C.32o: @@\ $(RM) $@ @@\ $(CC) -c $(CFLAGS) $(CFLAGS32) $*.C -o $*.32o @@\ .C.64o: @@\ $(RM) $@ @@\ $(CC) -c $(CFLAGS) $(CFLAGS64) $*.C -o $*.64o @@\ .c.o: @@\ $(RM) $@ @@\ $(C_COMP) -c $(CFLAGS) $*.c @@\ .c.32o: @@\ $(RM) $@ @@\ $(C_COMP) -c $(CFLAGS) $(CFLAGS32) $*.c -o $*.32o @@\ .c.64o: @@\ $(RM) $@ @@\ $(C_COMP) -c $(CFLAGS) $(CFLAGS64) $*.c -o $*.64o @@\ LinuxKernelObjectRule() @@\ .C.ko: @@\ $(RM) $@ @@\ $(CC) -o $@ -c $(KCFLAGS) $*.C @@\ .S.o: @@\ $(RM) $@ @@\ $(CC) -o $@ -c $(CFLAGS) $*.S @@\ .S.ko: @@\ $(RM) $@ @@\ $(CC) -o $@ -c $(KCFLAGS) $*.S @@\ .c.pko: @@\ $(RM) $@ @@\ $(C_COMP) -o $@ -c $(PATCHED_KERNEL_FLAGS) $(KCFLAGS) $*.c @@\ .C.pko: @@\ $(RM) $@ @@\ $(CC) -o $@ -c $(PATCHED_KERNEL_FLAGS) $(KCFLAGS) $*.C @@\ .rpc.h: @@\ $(MKRPC) $*.rpc #define SharedObjectRule(shflags) @@\ .C.o: @@\ $(RM) $@ @@\ $(CC) -c $(CFLAGS) shflags $*.C @@\ .c.o: @@\ $(RM) $@ @@\ $(C_COMP) -c $(CFLAGS) shflags $*.c @@\ .c.ko: @@\ $(RM) $@ @@\ $(C_COMP) -o $@ -c $(KCFLAGS) shflags $*.c @@\ .C.ko: @@\ $(RM) $@ @@\ $(CC) -o $@ -c $(KCFLAGS) shflags $*.C @@\ .S.o: @@\ $(RM) $@ @@\ $(CC) -o $@ -c $(CFLAGS) shflags $*.S @@\ .S.ko: @@\ $(RM) $@ @@\ $(CC) -o $@ -c $(KCFLAGS) shflags $*.S #define NormalYaccRule() @@\ .y.o: @@\ $(YACC) $(YFLAGS) $< @@\ $(MV) y.tab.c $*.c @@\ $(NATIVE_C_COMP) -c ${NATIVECFLAGS} $*.c @@\ $(RM) $*.c @@\ [ -f y.tab.h ] && $(MV) -f y.tab.h $*.h #define NormalAsmPPRule() @@\ .spp.o: @@\ $(RM) $@ ,$*.s ,$*.c @@\ $(CP) $*.spp ,$*.c @@\ $(C_COMP) -E $(CFLAGS) ,$*.c > ,$*.s @@\ $(AS) -o $*.o ,$*.s @@\ $(RM) ,$*.c ,$*.s #define NormalLexRule() @@\ .l.o: @@\ $(LEX) $*.l @@\ $(RM) $*.c @@\ $(MV) lex.yy.c $*.c @@\ $(C_COMP) -c $(CFLAGS) $*.c @@\ $(RM) $*.c #define NormalAsmRule() @@\ .s.o: @@\ $(RM) $@ @@\ $(AS) -o $*.o $*.s #define SharkAsmRule() @@\ .s.o: @@\ $(RM) $@ @@\ m4 $(M4FLAGS) $(ALL_DEFINES) -I/usr/include /usr/include/sys/asdef.s $*.s | as $(ASFLAGS) -o $*.o #define ShellScriptRule(File) @@\ .sh: @@\ cp $< $@; chmod 0777 $@ #define RpmRule(rpmfile, specfile, imagetree, rpmflags) @@\ rpm:: rpmfile @@\ rpmfile: specfile @@\ $(RM) rpmfile @@\ if [ -e imagetree ]; then \ @@\ $(RM) -r imagetree; \ @@\ fi; @@\ [ -e $(RPMBUILD) ] && rpmbuild=$(RPMBUILD) || rpmbuild=rpm; \@@\ $$rpmbuild -ba rpmflags --buildroot imagetree specfile #define CppAndFilter(file, lyfile, incfiles, filter) @@\ file: lyfile incfiles @@\ $(RM) file @@\ $(CPP) lyfile | filter > file #define AppendFiles(target, sources) @@\ target: sources @@\ $(RM) target @@\ cat sources > target #define TestingOnlyTestingRule(libs, syslibs) @@\ .SUFFIXES: .test @@\ .c.test: @@\ $(RM) $@ @@\ $(C_COMP) $(TESTING_CFLAGS) -o $*.test $*.c libs syslibs @@\ $(RM) $*.o @@\ clean:: ; $(RM) *.test #define LibraryTarget(library, objs) @@\ libs:: library @@\ library: objs @@\ $(RM) $@ @@\ $(AR) $(ARFLAGS) $@ objs #define kLibraryTarget(library, objs) @@\ libs:: library @@\ library: objs @@\ $(RM) $@ @@\ $(KAR) $(KARFLAGS) $@ objs #ifndef GPFS_LINUX #define SharedObjectTarget(shared, objs, imps, exps, other) @@\ shared: objs imps exps @@\ $(RM) $@ @@\ @ IMPS= ; EXPS= ; COL=\: ; \ @@\ for i in imps ; \ @@\ do IMPS="$${IMPS} -bI$${COL}$${i}" ; \ @@\ done; \ @@\ for i in exps ; \ @@\ do EXPS="$${EXPS} -bE$${COL}$${i}" ; \ @@\ done; \ @@\ echo " ld -o $@ objs $(LDFLAGS2) -bnoentry -bM\:SRE $${IMPS} $${EXPS} other" ; \ @@\ ld -o $@ objs $(LDFLAGS2) -bnoentry -bM\:SRE $${IMPS} $${EXPS} other #else /* GPFS_LINUX */ #define SharedObjectTarget(shared_obj, objs, other) @@\ libs:: shared_obj @@\ shared_obj: objs @@\ $(RM) $@ @@\ echo " $(BARELD) $(LDFLAGS2) -o $@ objs --shared other" ; \ @@\ $(BARELD) $(LDFLAGS2) -o $@ objs --shared other #endif /* GPFS_LINUX */ #define TestProgramTarget(program, objs, libs, syslibs) @@\ test:: program @@\ program: objs libs @@\ $(RM) $@ @@\ $(LD) -o $@ objs libs $(STD_LDFLAGS) $(IMAKE_LDFLAGS) $(ALL_LIBPATHS) syslibs @@\ cleanTest:: ; $(RM) program objs @@\ clean:: ; $(RM) program #ifndef GPFS_LINUX #define MsgTarget(basename) @@\ headers:: basename/**/_msg.h @@\ basename/**/_msg.h: basename.msg @@\ $(RM) basename/**/_msg.h @@\ mkcatdefs basename basename.msg | gencat $(DESTDIR)/mmfs.cat @@\ clean:: ; $(RM) basename/**/_msg.h #else #define MsgTarget(basename) @@\ headers:: basename/**/_msg.h @@\ basename/**/_msg.h: basename.msg @@\ $(RM) basename/**/_msg.h @@\ gencat -H basename/**/_tmp.h -o $(DESTDIR)/mmfs.cat basename/**/.msg @@\ sed "s/AutomaticSet[0-9]*/ /" basename/**/_tmp.h > basename/**/_msg.h @@\ $(RM) basename/**/_tmp.h @@\ clean:: ; $(RM) basename/**/_msg.h #endif #define ShellMsgTarget(basename) @@\ headers:: basename/**/_msg.h @@\ basename/**/_msg.h:: basename.msg @@\ $(RM) basename/**/_msg.h @@\ mkcatdefs basename basename.msg -h | gencat $(DESTDIR)/mmfs.cat @@\ basename/**/_msg.h:: basename.msg @@\ touch basename/**/_msg.h @@\ clean:: ; $(RM) basename/**/_msg.h #define TraceTarget(basename,files) @@\ trcid: files @@\ $(MKTRACE) -hm files @@\ trclst:: basename.trclst @@\ basename.trclst: files trcid.h @@\ $(RM) basename.trclst @@\ $(MKTRACE) -l basename.trclst files @@\ clean:: ; $(RM) basename.trclst #define RpcTarget(target) @@\ target.h: target.rpc #define NidlTarget(basename) @@\ libs:: basename.h @@\ depend:: basename.h @@\ basename.h: basename.idl @@\ $(NIDL) basename.idl $(NIDLINCLUDES) -no_cpp @@\ clean:: @@\ $(RM) basename.h @@\ @(for i in basename; do \ @@\ echo " "$(RM) $${i}C.c $${i}S.c $${i}W.c; \ @@\ $(RM) $${i}C.c $${i}S.c $${i}W.c; \ @@\ done) #define NativeProgramTarget(program, objs, libs, syslibs) @@\ all:: program @@\ program: objs libs @@\ $(RM) $@ @@\ $(NATIVE_LD) -o $@ objs libs $(STD_LDFLAGS) $(IMAKE_LDFLAGS) $(ALL_LIBPATHS) syslibs @@\ clean:: ; $(RM) program #define ProgramTarget(program, objs, libs, syslibs) @@\ all:: program @@\ program: objs libs @@\ $(RM) $@ @@\ $(LD) -o $@ objs libs $(STD_LDFLAGS) $(IMAKE_LDFLAGS) $(ALL_LIBPATHS) syslibs @@\ clean:: ; $(RM) program #define CProgramTarget(program, objs, libs, syslibs) @@\ all:: program @@\ program: objs libs @@\ $(RM) $@ @@\ $(C_COMP) -o $@ objs libs $(STD_LDFLAGS) $(IMAKE_LDFLAGS) $(ALL_LIBPATHS) syslibs @@\ clean:: ; $(RM) program #define CTestProgramTarget(program, objs, libs, syslibs) @@\ test:: program @@\ program: objs libs @@\ $(RM) $@ @@\ $(C_COMP) -o $@ objs libs $(STD_LDFLAGS) $(IMAKE_LDFLAGS) $(ALL_LIBPATHS) syslibs @@\ clean:: ; $(RM) program #define CleanTarget(files) @@\ clean:: ; $(RM) files #define MkdirTarget(dirs) @@\ install.ti:: makedirs @@\ @echo '\c' @@\ install.he:: makedirs @@\ @echo '\c' @@\ makedirs:: @@\ @echo "Checking Destination Directories...." @@\ @sh -c 'for i in dirs; do \ @@\ if [ -f $$i ]; then \ @@\ echo "Mkdir: $$i is a FILE"; \ @@\ exit 1; \ @@\ elif [ ! -d $$i ]; then \ @@\ echo "Making directory $$i"; \ @@\ mkdir -p $$i; \ @@\ fi; \ @@\ done; \ @@\ exit 0' #define DependTarget(dependencies) @@\ depend:: dependencies @@\ $(DEPENDSCRIPT) "$(MAKEDEPEND)" \ @@\ "$(ALL_KINCLUDES) $(CPLUSINC) -I/" "$(ALL_DEFINES)" /* -I/ added to circumvent grossness of makedepend */ #define DependTargetK(dependencies) @@\ depend:: dependencies @@\ $(DEPENDSCRIPT) "$(MAKEDEPEND)" \ @@\ "$(ALL_KINCLUDES) $(CPLUSINC) -I/" "$(ALL_DEFINES)" "$(ALL_KDEFINES)" /* -I/ added to circumvent grossness of makedepend */ #define DependTargetPK(dependencies) @@\ depend:: dependencies @@\ $(DEPENDSCRIPT) "$(MAKEDEPEND)" \ @@\ "$(ALL_KINCLUDES) $(CPLUSINC) -I/" "$(ALL_DEFINES) -D__KERNEL__" "$(ALL_KDEFINES) -D__KERNEL__" "$(PATCHED_KERNEL_FLAGS) -D__KERNEL__" /* *================================================== * Installation rules *================================================== * Exported rules: * InstallDocs() * InstallFileToFile() * InstallFiles() * InstallHeaders() * InstallPatchedHeaders() * InstallHardLink() * InstallLibraries() * InstallLink() * InstallPrograms() *================================================== */ INSTUIDFLAGS = -c -m 4555 INSTLIBFLAGS = -c -m 0664 INSTINCFLAGS = -c -m 0444 INSTDOCFLAGS = -c -m 0444 INSTROOTFLAGS = -c $(EXTRAINSTROOTFLAGS) -m 0500 INSTROOTFLAGS2 = -c -m 0500 INSTPROGFLAGS = -c $(EXTRAINSTPROGFLAGS) -m 0555 INSTSHELLFLAGS = -c -m 0755 DASH_I = *-[^=\ ][i]* DASH_IK = *-[^=\ ][ik]* #define InstallFiles(files, mode, dest) @@\ install.ti:: files @@\ @(case '$(MAKEFLAGS)' in $(DASH_I)) set +e;; esac; \ @@\ changed="$?"; \ @@\ for i in $$changed; do \ @@\ (set -x; $(INSTALL) mode $$i dest/$$i) done) #define InstallHeaders(files, dest) @@\ install.he:: files @@\ @(case '$(MAKEFLAGS)' in $(DASH_I)) set +e;; esac; \ @@\ changed="$?"; \ @@\ for i in $$changed; do \ @@\ (set -x; $(INSTALL) $(INSTINCFLAGS) $$i dest/$$i) done) #define InstallPatchedHeaders(files, src, dest) @@\ install.he:: files @@\ @(case '$(MAKEFLAGS)' in $(DASH_I)) set +e;; esac; \ @@\ changed="$?"; \ @@\ for i in $$changed; do \ @@\ ($(PATCHSCRIPT) src dest $$i) done) #define InstallLibraries(libs, dest) @@\ library.ti:: libs @@\ @(case '$(MAKEFLAGS)' in $(DASH_I)) set +e;; esac; \ @@\ changed="$?"; \ @@\ for i in $$changed; do \ @@\ (set -x; \ @@\ $(INSTALL) $(INSTLIBFLAGS) $$i dest/$$i ) done) #define InstallFileToFile(file, mode, destfile) @@\ install.ti:: file @@\ $(INSTALL) mode file destfile #define ShipSupport(Destination) @@\ shipSupport:: $(SHIP_ROOT)/usr/lpp/$(LPP_NAME)/Destination @@\ $(SHIP_ROOT)/usr/lpp/$(LPP_NAME)/Destination: $(@F) @@\ [ -d $(@D) ] || mkdir -p $(@D) @@\ cp $(@F) $@ @@\ @@\ unshipSupport:: @@\ rm -f $(SHIP_ROOT)/usr/lpp/$(LPP_NAME)/Destination #define ShipFile(Destination,SourceFile,ProdName,Type,Owner,Group,Mode,Class,Size,CheckSum,Links,SymLinks,Program,Source,Acl,Xacl) @@\ shipFile:: $(SHIP_ROOT)/Destination @@\ $(SHIP_ROOT)/Destination:: SourceFile @@\ @[ -d $(@D) ] || mkdir -p $(@D) @@\ @([ -z "ProdName" ] && prodname=$(LOCAL_PROD_NAME) ||\ @@\ prodname=ProdName ;\ @@\ [ -n "Type" ] && type=Type || type="$(SHIP_TYPE)" ;\ @@\ [ -n "Owner" ] && owner=Owner || owner="$(SHIP_OWNER)";\ @@\ [ -n "Group" ] && group=Group || group="$(SHIP_GROUP)" ;\ @@\ [ -n "Mode" ] && mode=Mode || mode=555 ;\ @@\ [ -n "Class" ] && class_inv="Class" || class_inv="$(SHIP_CLASS)" ;\ @@\ [ "Type" = "DIRECTORY" ] && mkdir -p $(SHIP_ROOT)/Destination ; \ @@\ [ -z "SourceFile" ] || $(SHIP_CMD) -o $$owner -g $$group -m $$mode SourceFile $@ ;\ @@\ echo "\tShipping Destination ($$prodname)" ; \ @@\ [ -d $(SHIPDIR) ] || mkdir -p $(SHIPDIR) ; \ @@\ touch $(SHIPDIR)/$$prodname.il ||\ @@\ (echo "\nERROR: Failed to create file SHIPDIR/usr/lpp/$(LPP_NAME)/$$prodname.il" && exit 1) ;\ @@\ echo "Destination:" >> $(SHIPDIR)/$$prodname.il ;\ @@\ echo "\ttype = $$type" >> $(SHIPDIR)/$$prodname.il ;\ @@\ echo "\towner = $$owner" >> $(SHIPDIR)/$$prodname.il ;\ @@\ echo "\tgroup = $$group" >> $(SHIPDIR)/$$prodname.il ;\ @@\ if [ $$mode -gt 999 ] ; then \ @@\ if [ $$mode -ge 4000 -a $$mode -le 4999 ] ; then \ @@\ echo "\tmode = SUID,`expr $$mode - 4000`" >> \ @@\ $(SHIPDIR)/$$prodname.il ;\ @@\ elif [ $$mode -ge 2000 -a $$mode -le 2999 ] ; then \ @@\ echo "\tmode = SGID,`expr $$mode - 2000`" >> \ @@\ $(SHIPDIR)/$$prodname.il ;\ @@\ else \ @@\ ( echo "\nERROR: Unrecognized mode value $$mode" && exit 1 ); \ @@\ fi \ @@\ else \ @@\ echo "\tmode = $$mode" >> $(SHIPDIR)/$$prodname.il ;\ @@\ fi ; \ @@\ if [ "Type" != "DIRECTORY" ] ; then \ @@\ echo "\tclass = inventory,$$class_inv,$${prodname}" >> \ @@\ $(SHIPDIR)/$$prodname.il ;\ @@\ [ -z "Size" ] && echo "\tsize = `cksum < $@ | \ @@\ /bin/awk '{print $$2}'`" >> $(SHIPDIR)/$$prodname.il || \ @@\ echo "\tsize = Size" >> $(SHIPDIR)/$$prodname.il ; \ @@\ else \ @@\ echo "\tclass = $$class_inv,$${prodname}" >> \ @@\ $(SHIPDIR)/$$prodname.il ;\ @@\ fi ;\ @@\ [ -n "CheckSum" ] && echo "\tchecksum = CheckSum" >> $(SHIPDIR)/$$prodname.il || true ;\ @@\ [ -z "CheckSum" -a \( "Size" = "VOLATILE" \) ] && echo "\tchecksum = VOLATILE" >> $(SHIPDIR)/$$prodname.il || true ;\ @@\ [ -n "Links" ] && echo "\tlinks = Links" >> $(SHIPDIR)/$$prodname.il || true ;\ @@\ [ -n "SymLinks" ] && echo "\tsymlinks = SymLinks" >> $(SHIPDIR)/$$prodname.il || true ;\ @@\ [ -n "Program" ] && echo "\tprogram = Program" >> $(SHIPDIR)/$$prodname.il || true ;\ @@\ [ -n "Source" ] && echo "\tsource = Source\n" >> $(SHIPDIR)/$$prodname.il || true ;\ @@\ [ -n "Acl" ] && echo "\tacl = Acl\n" >> $(SHIPDIR)/$$prodname.il || true ;\ @@\ [ -n "Xacl" ] && echo "\txacl = Xacl\n" >> $(SHIPDIR)/$$prodname.il || true ;\ @@\ ) @@\ @@\ unshipFile:: @@\ -if [ -n "Destination" ] ; then \ @@\ [ ! -f $(SHIP_ROOT)/Destination ] || rm -f $(SHIP_ROOT)/Destination ;\ @@\ [ ! -d $(SHIP_ROOT)/Destination ] || rmdir $(SHIP_ROOT)/Destination ;\ @@\ fi @@\ @([ -z "ProdName" ] && prodname=$(LOCAL_PROD_NAME) || \ @@\ prodname=ProdName ;\ @@\ rm -f $(SHIP_ROOT)/usr/lpp/$(LPP_NAME)/$${prodname}.il ) #define InstallDocs(docs, mode, dest) @@\ install.ti:: docs @@\ @(case '$(MAKEFLAGS)' in $(DASH_I)) set +e;; esac; \ @@\ changed="$?"; \ @@\ for i in $$changed; do \ @@\ (set -x; $(INSTALL) $(INSTDOCFLAGS) $$i dest/$$i); \ @@\ done) #define InstallPrograms(files, dest) @@\ InstallFiles(files, $(INSTPROGFLAGS), dest) #define InstallRootPrograms(files, dest) @@\ InstallFiles(files, $(INSTROOTFLAGS), dest) #define InstallUidPrograms(files, dest) @@\ InstallFiles(files, $(INSTUIDFLAGS), dest) #define InstallHardLink(file, link) @@\ install.ti:: file @@\ $(RM) link @@\ ln file link #define InstallLink(file, link) @@\ install.ti:: @@\ $(RM) link @@\ $(LN) file link /* ***************************************************************** *\ * Internal (to template) rules \* ***************************************************************** */ #define GenericCleanTarget() @@\ clean:: @@\ $(RM) _POUND_* ,* *~ *.CKP *.BAK *.bak core @@\ $(RM) *.ln *.o *.32o *.64o *.po *.ko *.pko make.log *.a *.lst *.map *.so @@\ $(RM) install.ti install.he library.ti *.rpm #define MakefileTarget() @@\ makefile:: Imakefile $(IRULESRC)/imake.tmpl $(IRULESRC)/site.mcr @@\ $(IMAKE_CMD); \ @@\ touch .depends; \ @@\ cat .depends >>makefile #define SubdirTarget(dirs, mktag, string) @@\ mktag:: @@\ @(case '$(MAKEFLAGS)' in $(DASH_IK)) set +e;; esac; \ @@\ for i in dirs; do \ @@\ (cd $$i || exit $$?; \ @@\ echo string "(`pwd`)"; \ @@\ $(MAKE) $(MAKEDASH)$(MAKEFLAGS) $(MAKEEXTRA) DESTDIR=$(DESTDIR) mktag; \ @@\ exit $$?) || exit 1; \ @@\ done) #define MakeSubdirs(dirs) @@\ SubdirTarget(dirs, All, "making") #define InstallSubdirs(dirs) @@\ SubdirTarget(dirs, Install, "installing") #define InstLibSubdirs(dirs) @@\ SubdirTarget(dirs, InstallLibs, "Make-Install-Libraries-ing") #define LibSubdirs(dirs) @@\ SubdirTarget(dirs, Libs, "Make-Libraries-ing") #define MakeTestSubdirs(dirs) @@\ SubdirTarget(dirs, Test, "Make-Testing") #define dependInstallSubdirs(dirs) @@\ SubdirTarget(dirs, dependInstall, "depend-Installing") #define DependSubdirs(dirs) @@\ SubdirTarget(dirs, Depend, "Depending") #define CleanTestSubdirs(dirs) @@\ SubdirTarget(dirs, CleanTest, "cleaning tests") #define CleanSubdirs(dirs) @@\ SubdirTarget(dirs, Clean, "cleaning") #define CheckinSubdirs(dirs) @@\ SubdirTarget(dirs, Checkin, "checking mods in") #define ShipSubdirs(dirs) @@\ SubdirTarget(dirs, Ship, "Shipping") #define UnshipSubdirs(dirs) @@\ SubdirTarget(dirs, Unship, "Unshipping") #define HeaderSubdirs(dirs) @@\ SubdirTarget(dirs, Headers, "installing header files") #define MakeMakeSubdirs(dirs) @@\ Makefiles:: @@\ @(case '$(MAKEFLAGS)' in $(DASH_IK)) set +e;; esac; \ @@\ for i in dirs; do \ @@\ echo "Making Makefiles (`pwd`/$$i)"; \ @@\ $(MAKE) subdirMakefiles \ @@\ MAKE_SUBDIR=$$i || exit $$?; \ @@\ done) #define MakefileSubdirs(dirs) @@\ MakeMakeSubdirs(dirs) @@\ @@\ subdirMakefiles: @@\ cd $(MAKE_SUBDIR) || exit $$?; \ @@\ $(DOTDOTIMAKE_CMD); \ @@\ touch .depends; \ @@\ cat .depends >>makefile; \ @@\ $(MAKE) $(MAKEDASH)$(MAKEFLAGS) $(MAKEEXTRA) Makefiles all:: libs All:: all test:: Test:: test libs:: headers Libs:: libs installLibs:: trclst trclst:: installLibs:: libs installLibs:: library.ti InstallLibs:: installLibs instLibs:: installLibs InstLibs:: InstallLibs rpm:: depend:: headers depend:: makefile Depend:: depend install.he:: library.ti:: headers:: install.he Headers:: headers install.ti:: install:: headers install:: libs install:: all install:: install.ti Install:: install dependInstall:: depend dependInstall:: install clean:: Clean:: clean cleanTest:: CleanTest:: cleanTest update:: ; $(SRC_UPDATE_CMD) checkin:: ; $(SRC_CHECKIN_CMD) Checkin:: checkin config1:: config2:: finish:: World:: config1 World:: Makefiles World:: Clean World:: config2 World:: Headers World:: Depend World:: InstallLibs World:: Install World:: finish Ship:: shipReset Ship:: shipSupport Ship:: shipFile Unship:: unshipSupport Unship:: unshipFile shipReset:: GenericCleanTarget() #ifndef BOOTSTRAP MakefileTarget() #endif _POUND_################################################## _POUND_ The following comes from the local Imakefile _POUND_################################################## #include INCLUDE_IMAKEFILE _POUND_################################################## _POUND_ Back from the local Imakefile _POUND_################################################## Makefiles:: makefile #ifdef IHaveSubdirs MakeSubdirs($(SUBDIRS) $(EXTRASUBDIRS)) InstallSubdirs($(SUBDIRS)) MakeTestSubdirs($(SUBDIRS) $(EXTRASUBDIRS)) dependInstallSubdirs($(SUBDIRS)) DependSubdirs($(SUBDIRS)) CleanTestSubdirs($(SUBDIRS) $(EXTRASUBDIRS)) CleanSubdirs($(SUBDIRS) $(EXTRASUBDIRS)) CheckinSubdirs($(SUBDIRS) $(EXTRASUBDIRS)) MakefileSubdirs($(SUBDIRS) $(EXTRASUBDIRS)) HeaderSubdirs($(SUBDIRS) $(EXTRASUBDIRS)) LibSubdirs($(SUBDIRS) $(EXTRASUBDIRS)) InstLibSubdirs($(SUBDIRS) $(EXTRASUBDIRS)) ShipSubdirs($(SUBDIRS)) UnshipSubdirs($(SUBDIRS)) #endif installLibs::afterInstallLibs afterInstallLibs:: shipFile shipSupport:: unshipFile unshipSupport:: library.ti:: touch library.ti install.he:: touch install.he install.ti:: touch install.ti listdirs: @echo ${SUBDIRS} _POUND_#### DEPENDENCY LINE - DO NOT DELETE #####