From b0da1cff58ffa6fd92e85490d4b839b2641f2083 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Mon, 8 Sep 2008 11:12:44 +0000 Subject: [PATCH] 2008-09-08 13:01 UTC+0200 Viktor Szakats (harbour.01 syenar hu) * contrib/mtpl_b32.mak * contrib/mtpl_vc.mak * contrib/mtpl_gcc.mak * Changed the location of intermediate obj and c files from /obj// to local [/contrib//]obj// dir so that similar filenames across different contribs would never interfere with each other anymore when using non-GNU make. This was a difficult to detect problem, especially when someone is trying to use custom contribs, and even more so if these custom contribs happen to have 3rd party code with non Harbour controlled filenames. This change is also an important last step to make contribs fully self-containing. ; TODO: mtpl_gcc.mak support has to be finished by someone familiar with bash. ; NOTE: This change shouldn't go to 1.0.1 until well tested and reviewed. ; NOTE: As a consequence of the above, from now on a 'make_*.bat clean' won't anymore clean the objects/.c file of all contribs. If you hadn't so so far, now you'll need to explicitly call 'contrib/make_*.all.bat clean' to do that. * contrib/mtpl_gcc.mak * make_gcc.mak % HB_ARCHITECTURE hack from cyg to w32 removed, as cyg is not a valid public architecture name in Harbour. cyg is used in make_gcc.sh internally, and it's automatically converted to w32 before using make_gcc.mak, so it would seem that this is solved at the right place already, and the hack is not needed. --- harbour/ChangeLog | 33 +++++++++++++++++++++++++++++++++ harbour/contrib/mtpl_b32.mak | 8 +++++++- harbour/contrib/mtpl_gcc.mak | 11 ++--------- harbour/contrib/mtpl_vc.mak | 8 +++++++- harbour/make_gcc.mak | 20 ++++++-------------- 5 files changed, 55 insertions(+), 25 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index d68358bdd5..0bfd519b1d 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -8,6 +8,39 @@ 2008-12-31 13:59 UTC+0100 Foo Bar (foo.bar foobar.org) */ +2008-09-08 13:01 UTC+0200 Viktor Szakats (harbour.01 syenar hu) + * contrib/mtpl_b32.mak + * contrib/mtpl_vc.mak + * contrib/mtpl_gcc.mak + * Changed the location of intermediate obj and c files from + /obj// to local [/contrib//]obj// + dir so that similar filenames across different contribs + would never interfere with each other anymore when using + non-GNU make. This was a difficult to detect problem, + especially when someone is trying to use custom contribs, + and even more so if these custom contribs happen to have + 3rd party code with non Harbour controlled filenames. This + change is also an important last step to make contribs + fully self-containing. + ; TODO: mtpl_gcc.mak support has to be finished by someone + familiar with bash. + ; NOTE: This change shouldn't go to 1.0.1 until well tested + and reviewed. + ; NOTE: As a consequence of the above, from now on a + 'make_*.bat clean' won't anymore clean the objects/.c + file of all contribs. If you hadn't so so far, now you'll + need to explicitly call 'contrib/make_*.all.bat clean' + to do that. + + * contrib/mtpl_gcc.mak + * make_gcc.mak + % HB_ARCHITECTURE hack from cyg to w32 removed, + as cyg is not a valid public architecture name + in Harbour. cyg is used in make_gcc.sh internally, and + it's automatically converted to w32 before using + make_gcc.mak, so it would seem that this is solved + at the right place already, and the hack is not needed. + 2008-09-08 11:44 UTC+0200 Viktor Szakats (harbour.01 syenar hu) * doc/whatsnew.txt * doc/dirstruc.txt diff --git a/harbour/contrib/mtpl_b32.mak b/harbour/contrib/mtpl_b32.mak index 24476a7445..3d2def4ee4 100644 --- a/harbour/contrib/mtpl_b32.mak +++ b/harbour/contrib/mtpl_b32.mak @@ -81,7 +81,8 @@ HB_LIB_INSTALL = $(HB_INSTALL_PREFIX)\lib HB_CC_DIRNAME = $(_HB_CC_NAME) !endif -OBJ_DIR = $(HB_ROOT)\obj\$(HB_CC_DIRNAME)\\ +OBJ_ROOT = obj +OBJ_DIR = $(OBJ_ROOT)\$(HB_CC_DIRNAME)\\ LIB_DIR = $(HB_ROOT)\lib\$(HB_CC_DIRNAME)\\ BIN_DIR = $(HB_ROOT)\bin\$(HB_CC_DIRNAME)\\ @@ -160,14 +161,17 @@ $(OBJ_DIR);\ #********************************************************** # General *.c --> *.obj COMPILE rule for STATIC Libraries {$(ALL_LIB_SRC_DIRS)}.c{$(OBJ_DIR)}$(OBJEXT): + if not exist "$(OBJ_DIR)" md "$(OBJ_DIR)" > nul $(CC) $(CLIBFLAGS) -o$@ $< #********************************************************** # General *.cpp --> *.obj COMPILE rule for STATIC Libraries {$(ALL_LIB_SRC_DIRS)}.cpp{$(OBJ_DIR)}$(OBJEXT): + if not exist "$(OBJ_DIR)" md "$(OBJ_DIR)" > nul $(CC) $(CLIBFLAGS: -P= ) -P -o$@ $< #********************************************************** # General *.prg --> *.obj COMPILE rule for STATIC Libraries {$(ALL_LIB_SRC_DIRS)}.prg{$(OBJ_DIR)}$(OBJEXT): + if not exist "$(OBJ_DIR)" md "$(OBJ_DIR)" > nul $(HB) $(HARBOURFLAGS) -o$(OBJ_DIR)\ $** $(CC) $(CLIBFLAGS) -o$@ $(OBJ_DIR)\$&.c #********************************************************** @@ -205,6 +209,8 @@ doClean: @_hbdeloa.bat @if exist _hbdeloa.bat $(DEL) _hbdeloa.bat > nul @if exist _hbdeloo.bat $(DEL) _hbdeloo.bat > nul + @if exist "$(OBJ_DIR)" rd "$(OBJ_DIR)" > nul 2> nul + @if exist "$(OBJ_ROOT)" rd "$(OBJ_ROOT)" > nul 2> nul !if "$(HB_INSTALL_PREFIX)" == "$(HB_ROOT)" @if exist $(HB_LIB_INSTALL)\$(LIBNAME)$(LIBEXT) $(DEL) $(HB_LIB_INSTALL)\$(LIBNAME)$(LIBEXT) > nul diff --git a/harbour/contrib/mtpl_gcc.mak b/harbour/contrib/mtpl_gcc.mak index c0866ae420..7611c2aa6a 100644 --- a/harbour/contrib/mtpl_gcc.mak +++ b/harbour/contrib/mtpl_gcc.mak @@ -26,14 +26,6 @@ endif #********************************************************** -ifeq ($(HB_ARCHITECTURE),cyg) -# Revert Cygwin architecture to w32. -# After all it's under Windows OS. -HB_ARCHITECTURE = w32 -endif - -#********************************************************** - ifndef ECHO ECHO = echo endif @@ -88,7 +80,8 @@ ifndef HB_CC_DIRNAME HB_CC_DIRNAME = $(_HB_CC_NAME) endif -OBJ_DIR = $(HB_ROOT)/obj/$(HB_CC_DIRNAME)/ +OBJ_ROOT = obj +OBJ_DIR = $(OBJ_ROOT)/$(HB_CC_DIRNAME)/ LIB_DIR = $(HB_ROOT)/lib/$(HB_CC_DIRNAME)/ BIN_DIR = $(HB_ROOT)/bin/$(HB_CC_DIRNAME)/ diff --git a/harbour/contrib/mtpl_vc.mak b/harbour/contrib/mtpl_vc.mak index 0f8c22c234..6e2426a7fc 100644 --- a/harbour/contrib/mtpl_vc.mak +++ b/harbour/contrib/mtpl_vc.mak @@ -78,7 +78,8 @@ HB_LIB_INSTALL = $(HB_INSTALL_PREFIX)\lib HB_CC_DIRNAME = $(_HB_CC_NAME) !endif -OBJ_DIR = $(HB_ROOT)\obj\$(HB_CC_DIRNAME)\\ +OBJ_ROOT = obj +OBJ_DIR = $(OBJ_ROOT)\$(HB_CC_DIRNAME)\\ LIB_DIR = $(HB_ROOT)\lib\$(HB_CC_DIRNAME)\\ BIN_DIR = $(HB_ROOT)\bin\$(HB_CC_DIRNAME)\\ @@ -151,14 +152,17 @@ LDFLAGS = $(LDFLAGS) #********************************************************** # General *.c --> *.obj COMPILE rule for STATIC Libraries {.}.c{$(OBJ_DIR)}$(OBJEXT):: + if not exist "$(OBJ_DIR)" md "$(OBJ_DIR)" > nul $(CC) $(CLIBFLAGS) -Fo$(OBJ_DIR)\ $< #********************************************************** # General *.cpp --> *.obj COMPILE rule for STATIC Libraries {.}.cpp{$(OBJ_DIR)}$(OBJEXT):: + if not exist "$(OBJ_DIR)" md "$(OBJ_DIR)" > nul $(CC) $(CLIBFLAGS: -TC= -TP) -Fo$(OBJ_DIR)\ $< #********************************************************** # General *.prg --> *.obj COMPILE rule for STATIC Libraries {.}.prg{$(OBJ_DIR)}$(OBJEXT): + if not exist "$(OBJ_DIR)" md "$(OBJ_DIR)" > nul $(HB) $(HARBOURFLAGS) -o$(OBJ_DIR)\ $< $(CC) $(CLIBFLAGS) -Fo$(OBJ_DIR)\ $(OBJ_DIR)\$(*B).c #********************************************************** @@ -194,6 +198,8 @@ doClean: < nul @if exist _hbdeloo.bat $(DEL) _hbdeloo.bat > nul + @if exist "$(OBJ_DIR)" rd "$(OBJ_DIR)" > nul 2> nul + @if exist "$(OBJ_ROOT)" rd "$(OBJ_ROOT)" > nul 2> nul !if "$(HB_INSTALL_PREFIX)" == "$(HB_ROOT)" @if exist $(HB_LIB_INSTALL)\$(LIBNAME)$(LIBEXT) $(DEL) $(HB_LIB_INSTALL)\$(LIBNAME)$(LIBEXT) > nul diff --git a/harbour/make_gcc.mak b/harbour/make_gcc.mak index 7ddd1dc658..a64a28868b 100644 --- a/harbour/make_gcc.mak +++ b/harbour/make_gcc.mak @@ -61,14 +61,6 @@ #********************************************************** -ifeq ($(HB_ARCHITECTURE),cyg) -# Revert Cygwin architecture to w32. -# After all it's under Windows OS. -HB_ARCHITECTURE = w32 -endif - -#********************************************************** - ifndef ECHO ECHO = echo endif @@ -103,8 +95,8 @@ endif # *before* common.cf is included OBJEXT=.o -EXEEXT=$(if $(findstring $(HB_ARCHITECTURE),w32 cyg dos os2),.exe) -DLLEXT=$(if $(findstring $(HB_ARCHITECTURE),w32 cyg dos os2),.dll,.so) +EXEEXT=$(if $(findstring $(HB_ARCHITECTURE),w32 dos os2),.exe) +DLLEXT=$(if $(findstring $(HB_ARCHITECTURE),w32 dos os2),.dll,.so) LIBEXT=.a LIBPREF=lib @@ -125,7 +117,7 @@ include common.cf # building CONSOLE programs. Otherwise we're building # GUI programs without console. Please note IT IS A # DIRTY HACK and any better solution is HIGHLY WELCOME -ifneq ($(findstring $(HB_ARCHITECTURE),w32 cyg os2),) +ifneq ($(findstring $(HB_ARCHITECTURE),w32 os2),) MAIN_LIB = $(LIB_DIR)/$(LIBPREF)mainstd$(LIBEXT) MAIN_LIB_OBJS = $(OBJ_DIR)/mainstd$(OBJEXT) @@ -158,7 +150,7 @@ endif # DLLs on Windows require IMPORT lib # and an additional compiler phase -ifneq ($(findstring $(HB_ARCHITECTURE),w32 cyg),) +ifneq ($(findstring $(HB_ARCHITECTURE),w32),) HB_DLL_IMPLIB := $(HARBOUR_DLL:$(DLLEXT)=$(LIBEXT)) HB_IMPLIB_PART := -Wl,--out-implib,$(HB_DLL_IMPLIB) endif @@ -194,7 +186,7 @@ CEXEFLAGSDLL := $(CFLAGS) $(CEXEFLAGSDLL) # Under architectures other than "DOS based" add -fPIC # to gcc compiler flags for compiling shared libraries -ifeq ($(findstring $(HB_ARCHITECTURE),w32 cyg os2),) +ifeq ($(findstring $(HB_ARCHITECTURE),w32 os2),) ifeq ($(findstring -fPIC,$(CLIBFLAGSDLL)),) CLIBFLAGSDLL := -fPIC $(CLIBFLAGSDLL) endif @@ -317,7 +309,7 @@ $(COMPILER_LIB) : $(COMPILER_LIB_OBJS) $(VM_LIB) : $(VM_LIB_OBJS) $(MKLIB) $(ARFLAGS) $@ $^ #********************************************************** -ifneq ($(findstring $(HB_ARCHITECTURE),w32 cyg os2),) +ifneq ($(findstring $(HB_ARCHITECTURE),w32 os2),) $(MAIN_LIB) : $(MAIN_LIB_OBJS) $(MKLIB) $(ARFLAGS) $@ $^ endif