* win-pre.in, win-post.in: Improve output directory creation and cleanup
authorDanilo Almeida <dalmeida@mit.edu>
Fri, 22 Jun 2001 03:08:00 +0000 (03:08 +0000)
committerDanilo Almeida <dalmeida@mit.edu>
Fri, 22 Jun 2001 03:08:00 +0000 (03:08 +0000)
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@13472 dc483132-0cff-0310-8789-dd5450dbe970

src/config/ChangeLog
src/config/win-post.in
src/config/win-pre.in

index da43b172e0581518abb72135af32fc42526d01da..d3c448738881f87f54f99b375d7d397aea435631 100644 (file)
@@ -1,3 +1,8 @@
+2001-06-21  Danilo Almeida  <dalmeida@mit.edu>
+
+       * win-pre.in, win-post.in: Improve output directory creation and
+       cleanup.
+
 2001-06-18  Ezra Peisach  <epeisach@mit.edu>
 
        * pre.in (KADM_COMM_DEPLIBS): Depend on GSSRPC_DEPLIBS and not
index 99fb81ac882fd06babf47e52b0e53884edb84aa1..41dfb0149f486d91592a19ee22c494e8c48fc6bb 100644 (file)
@@ -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
index 2cc92c141c13baf55826b7a6f9e42a6f7e225667..694603ee9a6ddbfbdcd5281d86c8e324144ddc8e 100644 (file)
@@ -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:
 #