From: Danilo Almeida Date: Fri, 22 Jun 2001 03:08:00 +0000 (+0000) Subject: * win-pre.in, win-post.in: Improve output directory creation and cleanup X-Git-Tag: krb5-1.3-alpha1~1314 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=8396f6475785bc2c053bf6a0dfa28fd9f6922a1e;p=krb5.git * win-pre.in, win-post.in: Improve output directory creation and cleanup git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@13472 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/config/ChangeLog b/src/config/ChangeLog index da43b172e..d3c448738 100644 --- a/src/config/ChangeLog +++ b/src/config/ChangeLog @@ -1,3 +1,8 @@ +2001-06-21 Danilo Almeida + + * win-pre.in, win-post.in: Improve output directory creation and + cleanup. + 2001-06-18 Ezra Peisach * pre.in (KADM_COMM_DEPLIBS): Depend on GSSRPC_DEPLIBS and not diff --git a/src/config/win-post.in b/src/config/win-post.in index 99fb81ac8..41dfb0149 100644 --- a/src/config/win-post.in +++ b/src/config/win-post.in @@ -5,7 +5,7 @@ !if defined(NO_OUTPRE) || defined(NO_OUTDIR) outpre-dir:: !else -outpre-dir:: $(OUTPRE3) +outpre-dir:: $(OUTPRE3)$(DIRNUL) !endif # @@ -49,11 +49,9 @@ $(LIBNAME): $(OBJFILEDEP) !if defined(OBJFILE) all-windows:: $(OBJFILE) -clean-windows:: - $(RM) $(OBJFILE) !if defined(LIBOBJS) $(OBJFILE): $(LIBOBJS) - $(RM) $(OBJFILE) + if exist $(OBJFILE) del $(OBJFILE) !if defined(PREFIXDIR) $(LIBECHO) -p $(PREFIXDIR)\ $** > $(OBJFILE) !else @@ -66,48 +64,35 @@ $(OBJFILE): $(LIBOBJS) check:: check-windows:: -.depend: $(SRCS) $(SRCTOP)/util/depfix.sed - if test -n "$(SRCS)" ; then \ - $(CC) -M $(CFLAGS) $(SRCS) | \ - sed -f $(SRCTOP)/util/depfix.sed | \ - sed -e 's; $(SRCTOP)/; $$(SRCTOP)/;g' | \ - sed -e 's; $(srcdir)/; $$(srcdir)/;g' | \ - sed -e 's; $(BUILDTOP)/; $$(BUILDTOP)/;g' | \ - sed -e 's; \./; ;g' > .depend; \ - else :; fi - -depend:: .depend - if test -n "$(SRCS)" ; then \ - sed -e '/^# +++ Dependency line eater +++/,$$d' \ - < $(srcdir)/Makefile.in | cat - .depend \ - > $(srcdir)/Makefile.in.new; \ - $(MV) $(srcdir)/Makefile.in $(srcdir)/Makefile.in.old; \ - $(MV) $(srcdir)/Makefile.in.new $(srcdir)/Makefile.in; \ - else :; fi - -clean:: clean-$(WHAT) - $(RM) config.log pre.out post.out Makefile.out - -clean-unix:: - if test -n "$(OBJS)" ; then $(RM) $(OBJS); else :; fi - $(RM) .depend - !if defined(LIBNAME) clean-windows:: - $(RM) $(LIBNAME) +# NO LONGER NEEDED BECAUSE WE CLEAN OUT THE DIR... +# if exist $(LIBNAME) del $(LIBNAME) !endif !if defined(OBJFILE) clean-windows:: - $(RM) $(OBJFILE) +# NO LONGER NEEDED BECAUSE WE CLEAN OUT THE DIR... +# if exist $(OBJFILE) del $(OBJFILE) !endif clean-windows:: clean-windows-files clean-windows-dir + # This needs to be in the post because we need RM to be defined in terms # of BUILDTOP clean-windows-files:: +!if "$(OUTPRE3)" == "" +!error ASSERTION FAILURE: OUTPRE3 must be defined!!! +!endif +!if "$(OS)" == "Windows_NT" + @if exist $(OUTPRE3)$(DIRNUL) rd /s/q $(OUTPRE3) +!else + @if exist $(OUTPRE3)$(DIRNUL) deltree /y $(OUTPRE3) +!endif +!if 0 $(RM) .\$(OUTPRE)*.obj .\$(OUTPRE)*.res $(RM) .\$(OUTPRE)*.exe .\$(OUTPRE)*.dll $(RM) .\$(OUTPRE)*.lib .\$(OUTPRE)*.pdb $(RM) .\$(OUTPRE)*.exp .\$(OUTPRE)*.map $(RM) .\$(OUTPRE)*.idb .\$(OUTPRE)*.ilk +!endif diff --git a/src/config/win-pre.in b/src/config/win-pre.in index 2cc92c141..694603ee9 100644 --- a/src/config/win-pre.in +++ b/src/config/win-pre.in @@ -39,9 +39,9 @@ CPU=i386 # !if "$(OS)" == "Windows_NT" -NULL= +DIRNUL= !else -NULL=nul +DIRNUL=\nul !endif # NOTE: ^ is an escape char for NMAKE. @@ -55,17 +55,22 @@ OUTPRE2=$(OUTPRE1)\$(CPU) OUTPRE3=$(OUTPRE2)\$(OUTPRE_DBG) OUTPRE=$(OUTPRE3)^\ -$(OUTPRE3): - -@if not exist $(OUTPRE1)\nul mkdir $(OUTPRE1) - -@if not exist $(OUTPRE2)\nul mkdir $(OUTPRE2) - -@if not exist $(OUTPRE3)\nul mkdir $(OUTPRE3) - -@if exist $(OUTPRE3)\nul echo Output will go to $(OUTPRE3). - -@if not exist $(OUTPRE3)\nul echo Could not create $(OUTPRE3). +$(OUTPRE3)$(DIRNUL): + -@if not exist $(OUTPRE1)$(DIRNUL) mkdir $(OUTPRE1) + -@if not exist $(OUTPRE2)$(DIRNUL) mkdir $(OUTPRE2) + -@if not exist $(OUTPRE3)$(DIRNUL) mkdir $(OUTPRE3) + @if exist $(OUTPRE3)$(DIRNUL) echo Output going into $(OUTPRE3) + @if not exist $(OUTPRE1)$(DIRNUL) echo The directory $(OUTPRE1) could not be created. + @if exist $(OUTPRE1)$(DIRNUL) if not exist $(OUTPRE2)$(DIRNUL) echo The directory $(OUTPRE2) could not be created. + @if exist $(OUTPRE2)$(DIRNUL) if not exist $(OUTPRE3)$(DIRNUL) echo The directory $(OUTPRE3) could not be created. + clean-windows-dir:: - -@if exist $(OUTPRE3)\nul rmdir $(OUTPRE3) - -@if exist $(OUTPRE2)\nul rmdir $(OUTPRE2) - -@if exist $(OUTPRE1)\nul rmdir $(OUTPRE1) + -@if exist $(OUTPRE3)$(DIRNUL) rmdir $(OUTPRE3) + -@if exist $(OUTPRE2)$(DIRNUL) rmdir $(OUTPRE2) + -@if exist $(OUTPRE1)$(DIRNUL) rmdir $(OUTPRE1) + @if exist $(OUTPRE2)$(DIRNUL) echo The directory $(OUTPRE2) is not empty. + @if not exist $(OUTPRE2)$(DIRNUL) if exist $(OUTPRE1)$(DIRNUL) echo The directory $(OUTPRE1) is not empty. # Directory syntax: #