From: John Carr Date: Wed, 25 Mar 1992 15:05:27 +0000 (+0000) Subject: Support alternate source directory X-Git-Tag: krb5-1.0-beta2~194 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=cfaafe238b3c4eaf74d94c0500a1216fcfb5cce6;p=krb5.git Support alternate source directory git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@2268 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/config/Imake.rules b/src/config/Imake.rules index 1a1649011..c6570fe93 100644 --- a/src/config/Imake.rules +++ b/src/config/Imake.rules @@ -570,7 +570,7 @@ target:: $(IMAKE) Imakefile #ifndef BuildMakefileTarget #define BuildMakefileTarget(imakefile,imakeflags) @@\ ImakeDependency(Makefile) @@\ - $(IMAKE_CMD) -DTOPDIR=$(TOP) -DCURDIR=$(CURRENT_DIR) imakeflags -s Makefile.new @@\ + $(IMAKE_CMD) -DTOPDIR=$(TOP) -DCURDIR=$(CURRENT_DIR) -f$(SRCDIR)Imakefile imakeflags -s Makefile.new @@\ $(MAKE) -f Makefile.new noop @@\ -@if [ -f Makefile ]; then \ @@\ echo "$(RM) Makefile.bak; $(MV) Makefile Makefile.bak"; \ @@\ @@ -601,7 +601,7 @@ BuildMakefileTarget(Imakefile, /**/) #define NormalLibraryObjectRule() @@\ .c.o: @@\ $(RM) $@ @@\ - $(CC) -c $(CFLAGS) $*.c + $(CC) -c $(CFLAGS) $(SRCDIR)$*.c #endif /* NormalLibraryObjectRule */ #ifndef NormalFortranObjectRule @@ -623,9 +623,9 @@ all:: @@\ @@\ .c.o: @@\ $(RM) $@ profiled/$@ @@\ - $(CC) -pg -c $(CFLAGS) $*.c @@\ + $(CC) -pg -c $(CFLAGS) $(SRCDIR)$*.c @@\ $(MV) $*.o profiled/$*.o @@\ - $(CC) -c $(CFLAGS) $*.c @@\ + $(CC) -c $(CFLAGS) $(SRCDIR)$*.c @@\ @@\ clean:: @@\ -@if [ -d profiled ]; then echo " $(RM) profiled/?*.o"; \ @@\ @@ -645,9 +645,9 @@ all:: @@\ @@\ .c.o: @@\ $(RM) $@ debugger/$@ @@\ - $(CC) -g -c $(CFLAGS) $*.c @@\ + $(CC) -g -c $(CFLAGS) $(SRCDIR)$*.c @@\ $(MV) $*.o debugger/$*.o @@\ - $(CC) -c $(CFLAGS) $*.c @@\ + $(CC) -c $(CFLAGS) $(SRCDIR)$*.c @@\ @@\ clean:: @@\ -@if [ -d debugger ]; then echo " $(RM) debugger/?*.o"; \ @@\ @@ -668,11 +668,11 @@ all:: @@\ @@\ .c.o: @@\ $(RM) $@ profiled/$@ debugger/$@ @@\ - $(CC) -pg -c $(CFLAGS) $*.c @@\ + $(CC) -pg -c $(CFLAGS) $(SRCDIR)$*.c @@\ $(MV) $*.o profiled/$*.o @@\ - $(CC) -g -c $(CFLAGS) $*.c @@\ + $(CC) -g -c $(CFLAGS) $(SRCDIR)$*.c @@\ $(MV) $*.o debugger/$*.o @@\ - $(CC) -c $(CFLAGS) $*.c @@\ + $(CC) -c $(CFLAGS) $(SRCDIR)$*.c @@\ @@\ clean:: @@\ -@if [ -d profiled ]; then echo " $(RM) profiled/?*.o"; \ @@\ @@ -694,9 +694,9 @@ all:: @@\ @@\ .c.o: @@\ $(RM) $@ shared/$@ @@\ - $(CC) -pic -c $(SHAREDCODEDEF) $(SHLIBDEF) $(CFLAGS) $*.c @@\ + $(CC) -pic -c $(SHAREDCODEDEF) $(SHLIBDEF) $(CFLAGS) $(SRCDIR)$*.c @@\ $(MV) $*.o shared/$*.o @@\ - $(CC) -c $(SHLIBDEF) $(CFLAGS) $*.c @@\ + $(CC) -c $(SHLIBDEF) $(CFLAGS) $(SRCDIR)$*.c @@\ @@\ clean:: @@\ -@if [ -d shared ]; then echo " $(RM) shared/?*.o"; \ @@\ @@ -716,11 +716,11 @@ all:: @@\ @@\ .c.o: @@\ $(RM) $@ shared/$@ debugger/$@ @@\ - $(CC) -pic -c $(SHAREDCODEDEF) $(SHLIBDEF) $(CFLAGS) $*.c @@\ + $(CC) -pic -c $(SHAREDCODEDEF) $(SHLIBDEF) $(CFLAGS) $(SRCDIR)$*.c @@\ $(MV) $*.o shared/$*.o @@\ - $(CC) -g -c $(SHLIBDEF) $(CFLAGS) $*.c @@\ + $(CC) -g -c $(SHLIBDEF) $(CFLAGS) $(SRCDIR)$*.c @@\ $(MV) $*.o debugger/$*.o @@\ - $(CC) -c $(SHLIBDEF) $(CFLAGS) $*.c @@\ + $(CC) -c $(SHLIBDEF) $(CFLAGS) $(SRCDIR)$*.c @@\ @@\ clean:: @@\ -@if [ -d shared ]; then echo " $(RM) shared/?*.o"; \ @@\ @@ -1195,88 +1195,61 @@ MakeLintSubdirs(dirs,lintlib,lintlib) #define MakeMakeSubdirs(dirs,target) @@\ target:: @@\ @case '${MFLAGS}' in *[ik]*) set +e;; esac; \ @@\ + case '${MFLAGS}' in *n*) executeit="no";; esac; \ @@\ for i in dirs ;\ @@\ do \ @@\ - echo "making Makefiles in $(CURRENT_DIR)/$$i..."; \ @@\ case "$$i" in \ @@\ - ./?*/?*/?*/?*) newtop=../../../../ sub=subsubsubsub;; \ @@\ - ./?*/?*/?*) newtop=../../../ sub=subsubsub;; \ @@\ - ./?*/?*) newtop=../../ sub=subsub;; \ @@\ - ./?*) newtop=../ sub=sub;; \ @@\ - */?*/?*/?*) newtop=../../../../ sub=subsubsubsub;; \ @@\ - */?*/?*) newtop=../../../ sub=subsubsub;; \ @@\ - */?*) newtop=../../ sub=subsub;; \ @@\ - *) newtop=../ sub=sub;; \ @@\ + ./?*/?*/?*/?*) newtop=../../../..;; \ @@\ + ./?*/?*/?*) newtop=../../..;; \ @@\ + ./?*/?*) newtop=../..;; \ @@\ + ./?*) newtop=..;; \ @@\ + */?*/?*/?*) newtop=../../../..;; \ @@\ + */?*/?*) newtop=../../..;; \ @@\ + */?*) newtop=../..;; \ @@\ + *) newtop=..;; \ @@\ esac; \ @@\ case "$(TOP)" in \ @@\ - /?*) newtop= upprefix= ;; \ @@\ - *) upprefix=../ ;; \ @@\ + /?*) imaketop=$(TOP) ; top=$(TOP) ; curdir=$(CURRENT_DIR)/;; \ @@\ + .) imaketop=$$newtop/ ; top=$$newtop ; curdir= ;; \ @@\ + *) imaketop=$$newtop/ ; top=$$newtop/$(TOP) ; curdir=$(CURRENT_DIR)/ ;; \ @@\ esac; \ @@\ - $(MAKE) $${sub}dirMakefiles UPPREFIX=$$upprefix NEWTOP=$$newtop \ @@\ - MAKEFILE_SUBDIR=$$i NEW_CURRENT_DIR=$(CURRENT_DIR)/$$i;\ @@\ + echo "making Makefiles in $${curdir}$$i..."; \ @@\ + cd $$i; \ @@\ + $(RM) Makefile.bak; \ @@\ + if [ -f Makefile ]; then \ @@\ + echo " $(MV) Makefile Makefile.bak"; \ @@\ + if [ "$$executeit" != "no" ]; then \ @@\ + $(MV) Makefile Makefile.bak; \ @@\ + fi; \ @@\ + fi; \ @@\ + if [ "$$executeit" != "no" ]; then \ @@\ + ImakeSubCmdHelper -DTOPDIR=$$top -DCURDIR=$${curdir}$$i -f$(SRCSUBDIR)Imakefile; \ @@\ + fi; \ @@\ + $(MAKE) $(MFLAGS) Makefiles; \ @@\ + cd $$newtop; \ @@\ done -#endif /* MakeMakeSubdirs */ +#ifdef SourceTop + SRCSUBDIR = SourceTop/$${curdir}$${i}/ +#endif -/* - * MakeNsubdirMakefiles - generate rules to create sub Makefiles. - */ -#ifndef MakeNsubdirMakefiles -#define MakeNsubdirMakefiles() @@\ -subdirMakefiles: @@\ - cd $(MAKEFILE_SUBDIR); $(IMAKE_CMD) -DTOPDIR=$(UPPREFIX)$(TOP) -DCURDIR=$(NEW_CURRENT_DIR) -s Makefile.new; \ @@\ - $(MAKE) -f Makefile.new noop @@\ - -@if [ -f $(MAKEFILE_SUBDIR)/Makefile ]; then \ @@\ - echo " $(RM) $(MAKEFILE_SUBDIR)/Makefile.bak; $(MV) $(MAKEFILE_SUBDIR)/Makefile $(MAKEFILE_SUBDIR)/Makefile.bak; $(MV) $(MAKEFILE_SUBDIR)/Makefile.new $(MAKEFILE_SUBDIR)/Makefile"; \ @@\ - $(RM) $(MAKEFILE_SUBDIR)/Makefile.bak; \ @@\ - $(MV) $(MAKEFILE_SUBDIR)/Makefile $(MAKEFILE_SUBDIR)/Makefile.bak; \ @@\ - fi; @@\ - $(MV) $(MAKEFILE_SUBDIR)/Makefile.new $(MAKEFILE_SUBDIR)/Makefile; \ @@\ - cd $(MAKEFILE_SUBDIR); $(MAKE) $(MFLAGS) Makefiles; @@\ - @@\ -subsubdirMakefiles: @@\ - cd $(MAKEFILE_SUBDIR); $(IMAKE_CMD) -DTOPDIR=$(UPPREFIX)$(TOP) -DCURDIR=$(NEW_CURRENT_DIR) -s Makefile.new; \ @@\ - $(MAKE) -f Makefile.new noop @@\ - -@if [ -f $(MAKEFILE_SUBDIR)/Makefile ]; then \ @@\ - echo " $(RM) $(MAKEFILE_SUBDIR)/Makefile.bak; $(MV) $(MAKEFILE_SUBDIR)/Makefile $(MAKEFILE_SUBDIR)/Makefile.bak; $(MV) $(MAKEFILE_SUBDIR)/Makefile.new $(MAKEFILE_SUBDIR)/Makefile"; \ @@\ - $(RM) $(MAKEFILE_SUBDIR)/Makefile.bak; \ @@\ - $(MV) $(MAKEFILE_SUBDIR)/Makefile $(MAKEFILE_SUBDIR)/Makefile.bak; \ @@\ - $(MV) $(MAKEFILE_SUBDIR)/Makefile.new $(MAKEFILE_SUBDIR)/Makefile; \ @@\ - cd $(MAKEFILE_SUBDIR); $(MAKE) $(MFLAGS) Makefiles; \ @@\ - else exit 0; fi @@\ - @@\ -subsubsubdirMakefiles: @@\ - cd $(MAKEFILE_SUBDIR); $(IMAKE_CMD) -DTOPDIR=$(UPPREFIX)$(TOP) -DCURDIR=$(NEW_CURRENT_DIR) -s Makefile.new; \ @@\ - $(MAKE) -f Makefile.new noop @@\ - -@if [ -f $(MAKEFILE_SUBDIR)/Makefile ]; then \ @@\ - echo " $(RM) $(MAKEFILE_SUBDIR)/Makefile.bak; $(MV) $(MAKEFILE_SUBDIR)/Makefile $(MAKEFILE_SUBDIR)/Makefile.bak; $(MV) $(MAKEFILE_SUBDIR)/Makefile.new $(MAKEFILE_SUBDIR)/Makefile"; \ @@\ - $(RM) $(MAKEFILE_SUBDIR)/Makefile.bak; \ @@\ - $(MV) $(MAKEFILE_SUBDIR)/Makefile $(MAKEFILE_SUBDIR)/Makefile.bak; \ @@\ - $(MV) $(MAKEFILE_SUBDIR)/Makefile.new $(MAKEFILE_SUBDIR)/Makefile; \ @@\ - cd $(MAKEFILE_SUBDIR); $(MAKE) $(MFLAGS) Makefiles; \ @@\ - else exit 0; fi @@\ - @@\ -subsubsubsubdirMakefiles: @@\ - cd $(MAKEFILE_SUBDIR); $(IMAKE_CMD) -DTOPDIR=$(UPPREFIX)$(TOP) -DCURDIR=$(NEW_CURRENT_DIR) -s Makefile.new; \ @@\ - $(MAKE) -f Makefile.new noop @@\ - -@if [ -f $(MAKEFILE_SUBDIR)/Makefile ]; then \ @@\ - echo " $(RM) $(MAKEFILE_SUBDIR)/Makefile.bak; $(MV) $(MAKEFILE_SUBDIR)/Makefile $(MAKEFILE_SUBDIR)/Makefile.bak; $(MV) $(MAKEFILE_SUBDIR)/Makefile.new $(MAKEFILE_SUBDIR)/Makefile"; \ @@\ - $(RM) $(MAKEFILE_SUBDIR)/Makefile.bak; \ @@\ - $(MV) $(MAKEFILE_SUBDIR)/Makefile $(MAKEFILE_SUBDIR)/Makefile.bak; \ @@\ - $(MV) $(MAKEFILE_SUBDIR)/Makefile.new $(MAKEFILE_SUBDIR)/Makefile; \ @@\ - cd $(MAKEFILE_SUBDIR); $(MAKE) $(MFLAGS) Makefiles; \ @@\ - else exit 0; fi -#endif /* MakeNsubdirMakefiles */ +#ifdef UseImakeInstalled +#define ImakeSubCmdHelper $(IMAKE) -I$${imaketop}$(NEWTOP)$(IRULESRC) $(IMAKE_DEFINES) +#else +#ifdef UseInstalled +#define ImakeSubCmdHelper $(IMAKE_CMD) +#else +#define ImakeSubCmdHelper $${imaketop}$(NEWTOP)$(IMAKE) -I$${imaketop}$(NEWTOP)$(IRULESRC) $(IMAKE_DEFINES) +#endif +#endif +#endif /* MakeMakeSubdirs */ /* * MakefileSubdirs - generate rules to create Makefiles. */ #ifndef MakefileSubdirs -#define MakefileSubdirs(dirs) @@\ -MakeMakeSubdirs(dirs,Makefiles) @@\ - @@\ -MakeNsubdirMakefiles() +#define MakefileSubdirs(dirs) MakeMakeSubdirs(dirs,Makefiles) #endif /* MakefileSubdirs */ diff --git a/src/config/Imake.tmpl b/src/config/Imake.tmpl index af105f5b3..c4feecac6 100644 --- a/src/config/Imake.tmpl +++ b/src/config/Imake.tmpl @@ -574,6 +574,12 @@ #define MakeDependFlags /**/ #endif +#ifdef SourceTop + SRCDIR = SourceTop/CURDIR/ + VPATH = SourceTop/CURDIR + SRCTOP = SourceTop + SRCINCLUDE = -I/**/SourceTop/CURDIR +#endif SHELL = BourneShell TOP = TOPDIR diff --git a/src/config/Project.tmpl b/src/config/Project.tmpl index 2189283bc..236451008 100644 --- a/src/config/Project.tmpl +++ b/src/config/Project.tmpl @@ -107,6 +107,10 @@ basename/**/_defs.h basename/**/_pre_defs.h basename-types.h basename/**/_tables #endif +#ifdef LibraryRules +#include LibraryRules +#endif + /* * AdditiveLibraryTarget - generate rules to create a library from * several directories @@ -185,7 +189,8 @@ includes:: hfile @@\ newname: stockname Makefile @@\ -$(RM) newname.new @@\ -$(UNIFDEF) $(PROCESS_DEFINES) stockname >newname.new @@\ - CopyHeaderNewName(newname.new,.,newname) + if cmp -s newname.new newname ; then true; \ @@\ + else $(RM) newname ; $(CP) newname.new newname ; fi #endif /* ProcessStockHeader */ /* @@ -310,20 +315,13 @@ clean:: @@\ */ #ifndef SimpleTestProgramTarget #define SimpleTestProgramTarget(program) @@\ - OBJS = program.o @@\ - SRCS = program.c @@\ - PROGRAM = program @@\ - @@\ AllTarget(program) @@\ @@\ -program: $(OBJS) $(DEPLIBS) @@\ +program: program.o $(DEPLIBS) @@\ RemoveTargetProgram($@) @@\ - $(CC) -o $@ $(OBJS) $(LDOPTIONS) $(LOCAL_LIBRARIES) $(LDLIBS) $(EXTRA_LOAD_FLAGS) @@\ + $(CC) -o $@ program.o $(LDOPTIONS) $(LOCAL_LIBRARIES) $(LDLIBS) $(EXTRA_LOAD_FLAGS) @@\ @@\ -SaberProgramTarget(program,$(SRCS),$(OBJS),$(LOCAL_LIBRARIES), /**/) @@\ - @@\ -DependTarget() @@\ -LintTarget() @@\ +SaberProgramTarget(program,program.c,program.o,$(LOCAL_LIBRARIES), /**/)@@\ @@\ clean:: @@\ $(RM) $(PROGRAM) @@ -441,7 +439,11 @@ P_VOLATILE=-UUseVolatile */ ARADD = ArAddCmd +#ifdef SourceTop + TOP_INCLUDES = -I$(TOP)/include -I/**/SourceTop/include $(STDC_TOP_INCLUDES) +#else TOP_INCLUDES = -I$(TOP)/include $(STDC_TOP_INCLUDES) +#endif CONFIGSRC = $(TOP)/config ISODE = IsodeDir PSYFLAGS = PepsyFlags diff --git a/src/kdc/Imakefile b/src/kdc/Imakefile index fe95a2ab5..92da9d5fa 100644 --- a/src/kdc/Imakefile +++ b/src/kdc/Imakefile @@ -32,19 +32,19 @@ K4LIB= #endif DEFINES = -DBACKWARD_COMPAT $(KRB4DEF) -INCLUDES = $(KRB4INCLUDES) +INCLUDES = $(KRB4INCLUDES) -I. SRCS= \ kdc5_err.c \ - dispatch.c \ - do_as_req.c \ - do_tgs_req.c \ - kdc_util.c \ - main.c \ - network.c \ - policy.c \ - extern.c \ - replay.c \ - kerberos_v4.c + $(SRCDIR)dispatch.c \ + $(SRCDIR)do_as_req.c \ + $(SRCDIR)do_tgs_req.c \ + $(SRCDIR)kdc_util.c \ + $(SRCDIR)main.c \ + $(SRCDIR)network.c \ + $(SRCDIR)policy.c \ + $(SRCDIR)extern.c \ + $(SRCDIR)replay.c \ + $(SRCDIR)kerberos_v4.c OBJS= \ kdc5_err.o \ diff --git a/src/lib/krb5/error_tables/Imakefile b/src/lib/krb5/error_tables/Imakefile index 40e3ffce3..4cf8199ff 100644 --- a/src/lib/krb5/error_tables/Imakefile +++ b/src/lib/krb5/error_tables/Imakefile @@ -53,3 +53,6 @@ DependTarget() Krb5InstallHeaders($(ETHDRS), $(KRB5_INCDIR)/krb5) +SpecialObjectRule(isode_err.o,isode_err.c,) +SpecialObjectRule(krb5_err.o,krb5_err.c,) +SpecialObjectRule(kdb5_err.o,kdb5_err.c,)