buildsystem,ide,epj2make; sorted out platform variables and uses. now using HOST_PLAT...
authorRejean Loyer <rejean.loyer@gmail.com>
Tue, 23 Oct 2012 00:56:08 +0000 (20:56 -0400)
committerRejean Loyer <rejean.loyer@gmail.com>
Wed, 24 Oct 2012 05:36:04 +0000 (01:36 -0400)
39 files changed:
Makefile
compiler/Makefile
compiler/bootstrap/Makefile
compiler/bootstrap/ecc/Makefile
compiler/bootstrap/ecere/Makefile
compiler/bootstrap/ecp/Makefile
compiler/bootstrap/ecs/Makefile
compiler/bootstrap/libec/Makefile
compiler/ecc/Makefile
compiler/ecp/Makefile
compiler/ecs/Makefile
compiler/libec/Makefile
crossplatform.mk
deps/Makefile
deps/freetype-2.3.12/Makefile
deps/jpeg-6b/Makefile
deps/libffi-3.0.11/Makefile
deps/libpng-1.4.0/Makefile
deps/libungif-4.1.1/Makefile
deps/zlib/Makefile
documentor/Makefile
ear/Makefile
ear/cmd/Makefile
ear/extract/Makefile
ecere/Makefile
ecere/Makefile.ecereCOM
ecere/Makefile.vanilla
eda/Makefile
eda/drivers/sqlite/Makefile
eda/drivers/sqliteCipher/Makefile
eda/libeda/Makefile
epj2make/Makefile
epj2make/epj2make.ec
ide/Makefile
ide/src/IDESettings.ec
ide/src/project/Project.ec
ide/src/project/ProjectNode.ec
ide/src/project/ProjectView.ec
include.mk

index 0dafc53..9f50ae5 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,11 +1,12 @@
 .PHONY: all clean realclean distclean emptyoutput prepinstall actualinstall install copyonlyinstall uninstall troubleshoot outputdirs bootstrap deps ecere ecerecom ecerevanilla ear compiler prepbinaries epj2make ide documentor eda prepcodeguard codeguard
 .SILENT:
 
+include crossplatform.mk
 include include.mk
 
 LIBVER := .0.44
 
-ifdef WINDOWS
+ifdef WINDOWS_TARGET
 
 SOV := $(SO)
 
@@ -50,7 +51,7 @@ export EXTRASDIR=$(DESTDIR)$(prefix)/extras
 endif
 
 
-else # WINDOWS
+else # WINDOWS_TARGET
 
 SOV := $(SO)$(LIBVER)
 
@@ -150,12 +151,12 @@ compiler: ecere ear
 
 prepbinaries: compiler ecerecom
        @$(call echo,Enabling 2nd stage binaries...)
-ifdef WINDOWS
+ifdef WINDOWS_TARGET
        $(call cpq,ecere/obj/release.$(PLATFORM)/$(LP)ecere$(SOV),$(OBJBINDIR))
        $(call cpq,ecere/obj/ecereCOM.release.$(PLATFORM)/$(LP)ecereCOM$(SOV),$(OBJBINDIR))
        $(call cpq,compiler/libec/obj/release.$(PLATFORM)/$(LP)ec$(SOV),$(OBJBINDIR))
 endif
-ifdef LINUX
+ifdef LINUX_TARGET
        $(call cpq,ecere/obj/release.$(PLATFORM)/$(LP)ecere$(SOV),$(OBJLIBDIR))
        $(call cpq,ecere/obj/ecereCOM.release.$(PLATFORM)/$(LP)ecereCOM$(SOV),$(OBJLIBDIR))
        $(call cpq,compiler/libec/obj/release.$(PLATFORM)/$(LP)ec$(SOV),$(OBJLIBDIR))
@@ -166,8 +167,8 @@ ifdef LINUX
        ln -sf $(LP)ecereCOM$(SOV) $(OBJLIBDIR)$(LP)ecereCOM$(SO)
        ln -sf $(LP)ec$(SOV) $(OBJLIBDIR)$(LP)ec$(SO)
 endif
-ifndef WINDOWS
-ifndef LINUX
+ifndef WINDOWS_TARGET
+ifndef LINUX_TARGET
        $(call cpq,ecere/obj/release.$(PLATFORM)/$(LP)ecere$(SO),$(OBJLIBDIR))
        $(call cpq,ecere/obj/ecereCOM.release.$(PLATFORM)/$(LP)ecereCOM$(SO),$(OBJLIBDIR))
        $(call cpq,compiler/libec/obj/release.$(PLATFORM)/$(LP)ec$(SO),$(OBJLIBDIR))
@@ -198,18 +199,18 @@ endif
 
 prepcodeguard: eda
 ifdef CodeGuard
-ifdef WINDOWS
+ifdef WINDOWS_TARGET
        $(call cpq,eda/libeda/obj/release.$(PLATFORM)/$(LP)EDA$(SO),$(OBJBINDIR))
 endif
 
-ifdef LINUX
+ifdef LINUX_TARGET
        $(call cpq,eda/libeda/obj/release.$(PLATFORM)/$(LP)EDA$(SOV),$(OBJLIBDIR))
        ln -sf $(LP)EDA$(SOV) $(OBJLIBDIR)$(LP)EDA$(SO).0
        ln -sf $(LP)EDA$(SOV) $(OBJLIBDIR)$(LP)EDA$(SO)
 endif
 
-ifndef WINDOWS
-ifndef LINUX
+ifndef WINDOWS_TARGET
+ifndef LINUX_TARGET
        $(call cpq,eda/libeda/obj/release.$(PLATFORM)/$(LP)EDA$(SO),$(OBJLIBDIR))
 endif
 endif
@@ -229,7 +230,7 @@ emptyoutput: outputdirs
 ifdef EDASQLiteCipher
        $(call rmq,$(SODESTDIR)$(LP)EDASQLiteCipher$(SO))
 endif
-ifdef LINUX
+ifdef LINUX_TARGET
        $(call rmq,$(SODESTDIR)$(LP)ecere$(SO).0)
        $(call rmq,$(SODESTDIR)$(LP)ecereCOM$(SO).0)
        $(call rmq,$(SODESTDIR)$(LP)ec$(SO).0)
@@ -333,7 +334,7 @@ endif
 # Binaries (always in $(OBJBINDIR)) and Static Libraries (always in $(OBJLIBDIR))
 prepinstall: $(DOC) $(BINARIES) outputdirs
 
-ifdef WINDOWS
+ifdef WINDOWS_TARGET
        $(call cpq,ecere/obj/release.$(PLATFORM)/$(LP)ecere$(SO),$(OBJBINDIR))
        $(call cpq,ecere/obj/ecereCOM.release.$(PLATFORM)/$(LP)ecereCOM$(SO),$(OBJBINDIR))
        $(call cpq,compiler/libec/obj/release.$(PLATFORM)/$(LP)ec$(SO),$(OBJBINDIR))
@@ -344,7 +345,7 @@ ifdef EDASQLiteCipher
 endif
 endif
 
-ifdef LINUX
+ifdef LINUX_TARGET
        $(call cpq,ecere/obj/release.$(PLATFORM)/$(LP)ecere$(SOV),$(OBJLIBDIR))
        $(call cpq,ecere/obj/ecereCOM.release.$(PLATFORM)/$(LP)ecereCOM$(SOV),$(OBJLIBDIR))
        $(call cpq,compiler/libec/obj/release.$(PLATFORM)/$(LP)ec$(SOV),$(OBJLIBDIR))
@@ -371,8 +372,8 @@ ifdef EDASQLiteCipher
 endif
 endif
 
-ifndef WINDOWS
-ifndef LINUX
+ifndef WINDOWS_TARGET
+ifndef LINUX_TARGET
        $(call cpq,ecere/obj/release.$(PLATFORM)/$(LP)ecere$(SO),$(OBJLIBDIR))
        $(call cpq,ecere/obj/ecereCOM.release.$(PLATFORM)/$(LP)ecereCOM$(SO),$(OBJLIBDIR))
        $(call cpq,compiler/libec/obj/release.$(PLATFORM)/$(LP)ec$(SO),$(OBJLIBDIR))
@@ -404,7 +405,7 @@ copyonlyinstall: actualinstall
        @$(call echo,The Ecere SDK has been installed. copyonlyinstall.)
 
 actualinstall:
-ifdef WINDOWS
+ifdef WINDOWS_TARGET
        $(call mkdirq,"$(BINDIR)/")
        $(call mkdirq,"$(SLIBDIR)/")
        $(call mkdirq,"$(DOCDIR)/")
@@ -433,7 +434,7 @@ endif
        $(call cpq,doc/EDA.eCdoc,"$(DOCDIR)/")
 endif
 
-ifdef OSX 
+ifdef OSX_TARGET
        install $(OBJLIBDIR)$(LP)ecere$(SO) $(LIBDIR)/
        install $(OBJLIBDIR)$(LP)ecereCOM$(SO) $(LIBDIR)/
        install $(OBJLIBDIR)$(LP)ec$(SO) $(LIBDIR)/
@@ -464,9 +465,9 @@ endif
        cp -pRf extras/* $(EXTRASDIR)
 endif
 
-ifndef OSX
-ifndef WINDOWS
-ifdef LINUX
+ifndef OSX_TARGET
+ifndef WINDOWS_TARGET
+ifdef LINUX_TARGET
        install -D $(OBJLIBDIR)$(LP)ecere$(SOV) $(LIBDIR)/$(LP)ecere$(SOV)
        install -D $(OBJLIBDIR)$(LP)ecereCOM$(SOV) $(LIBDIR)/$(LP)ecereCOM$(SOV)
        install -D $(OBJLIBDIR)$(LP)ec$(SOV) $(LIBDIR)/$(LP)ec$(SOV)
@@ -579,7 +580,7 @@ endif
        $(call rmq,"$(DOCDIR)/ecere.eCdoc")
        $(call rmq,"$(DOCDIR)/ecereCOM.eCdoc")
        $(call rmq,"$(DOCDIR)/EDA.eCdoc")
-ifdef LINUX
+ifdef LINUX_TARGET
        $(call rmq,"$(LIBDIR)/$(LP)ecere$(SO).0")
        $(call rmq,"$(LIBDIR)/$(LP)ecereCOM$(SO).0")
        $(call rmq,"$(LIBDIR)/$(LP)ec$(SO).0")
@@ -603,13 +604,24 @@ endif
        $(call rmdirq,"$(LIBDIR)/")
        $(call rmdirq,"$(SLIBDIR)/")
        $(call rmdirq,"$(DOCDIR)/")
-ifdef WINDOWS
+ifdef WINDOWS_TARGET
        $(call rmdirq,"$(DESTDIR)/")
 endif
        @$(call echo,The Ecere SDK has been uninstalled.)
 
 troubleshoot:
        @$(call echo,Printing values of some variables.)
+       @$(call echo,HOST_PLATFORM=$(HOST_PLATFORM))
+       @$(call echo,TARGET_PLATFORM=$(HOST_PLATFORM))
+       @$(call echo,PLATFORM=$(PLATFORM))
+       @$(call echo,LINUX_HOST=$(LINUX_HOST))
+       @$(call echo,LINUX_TARGET=$(LINUX_TARGET))
+       @$(call echo,OSX_HOST=$(OSX_HOST))
+       @$(call echo,OSX_TARGET=$(OSX_TARGET))
+       @$(call echo,WINDOWS_HOST=$(WINDOWS_HOST))
+       @$(call echo,WINDOWS_TARGET=$(WINDOWS_TARGET))
+       @$(call echo,BSD_HOST=$(BSD_HOST))
+       @$(call echo,BSD_TARGET=$(BSD_TARGET))
        @$(call echo,CCACHE=$(CCACHE))
        @$(call echo,CCACHE_COMPILE=$(CCACHE_COMPILE))
        @$(call echo,CCACHE_PREFIX=$(CCACHE_PREFIX))
index 8e59237..400185f 100644 (file)
@@ -5,6 +5,7 @@ CONFIG := release
 OBJ = libec/obj/$(CONFIG).$(PLATFORM)/
 PRECOMPILED_SOURCES = libec/precompiled/expression.c libec/precompiled/grammar.c libec/precompiled/type.c
 
+include ../crossplatform.mk
 include ../include.mk
 
 all: ecp ecc ecs
index 5a9ff84..2ace96c 100644 (file)
@@ -3,6 +3,7 @@
 
 OBJ = obj/bin.$(PLATFORM)/
 
+include ../../crossplatform.mk
 include ../../include.mk
 
 all: bindir ecere libec ecp ecc ecs
@@ -19,7 +20,7 @@ clean: bindir
        cd ecc && $(MAKE) clean
        cd ecs && $(MAKE) clean
        $(call rmq,$(OBJ)ecp$(E) $(OBJ)ecc$(E) $(OBJ)ecs$(E))
-ifdef WINDOWS
+ifdef WINDOWS_TARGET
        $(call rmq,$(OBJ)$(LP)ecere$(SO) $(OBJ)$(LP)ec$(SO))
 endif
 
index 2b66a4d..8fcabd3 100644 (file)
@@ -30,6 +30,7 @@ OFLAGS =
 
 # CROSS-PLATFORM MAGIC
 
+include ../../../crossplatform.mk
 include ../../../include.mk
 
 # FLAGS
@@ -50,21 +51,21 @@ LIBS = -lecereBootstrap -lecBootstrap $(SHAREDLIB) $(EXECUTABLE) $(LINKOPT)
 UPXFLAGS = -9 -q
 
 # HARD CODED PLATFORM-SPECIFIC OPTIONS
-ifdef LINUX
+ifdef LINUX_TARGET
 OFLAGS += -Wl,--no-undefined
 endif
 
 # PLATFORM-SPECIFIC OPTIONS
 
-ifdef WINDOWS
+ifdef WINDOWS_TARGET
 
 else
-ifdef LINUX
+ifdef LINUX_TARGET
 
 LIBS += -lm -ldl
 
 else
-ifdef OSX
+ifdef OSX_TARGET
 
 LIBS += -lm -ldl
 
index e1b4cdb..a79ab46 100644 (file)
@@ -76,6 +76,7 @@ OFLAGS =
 
 # CROSS-PLATFORM MAGIC
 
+include ../../../crossplatform.mk
 include ../../../include.mk
 
 # FLAGS
@@ -92,7 +93,7 @@ LIBS = $(SHAREDLIB) $(EXECUTABLE) $(LINKOPT)
 UPXFLAGS = -9 -q
 
 # HARD CODED PLATFORM-SPECIFIC OPTIONS
-ifdef LINUX
+ifdef LINUX_TARGET
 OFLAGS += -Wl,--no-undefined
 endif
 
index 6988534..ae15d35 100644 (file)
@@ -30,6 +30,7 @@ OFLAGS =
 
 # CROSS-PLATFORM MAGIC
 
+include ../../../crossplatform.mk
 include ../../../include.mk
 
 # FLAGS
@@ -50,21 +51,21 @@ LIBS = -lecereBootstrap -lecBootstrap $(SHAREDLIB) $(EXECUTABLE) $(LINKOPT)
 UPXFLAGS = -9 -q
 
 # HARD CODED PLATFORM-SPECIFIC OPTIONS
-ifdef LINUX
+ifdef LINUX_TARGET
 OFLAGS += -Wl,--no-undefined
 endif
 
 # PLATFORM-SPECIFIC OPTIONS
 
-ifdef WINDOWS
+ifdef WINDOWS_TARGET
 
 else
-ifdef LINUX
+ifdef LINUX_TARGET
 
 LIBS += -lm -ldl
 
 else
-ifdef OSX
+ifdef OSX_TARGET
 
 LIBS += -lm -ldl
 
index 5b37a6b..9e6976c 100644 (file)
@@ -30,6 +30,7 @@ OFLAGS =
 
 # CROSS-PLATFORM MAGIC
 
+include ../../../crossplatform.mk
 include ../../../include.mk
 
 # FLAGS
@@ -50,21 +51,21 @@ LIBS = -lecereBootstrap -lecBootstrap $(SHAREDLIB) $(EXECUTABLE) $(LINKOPT)
 UPXFLAGS = -9 -q
 
 # HARD CODED PLATFORM-SPECIFIC OPTIONS
-ifdef LINUX
+ifdef LINUX_TARGET
 OFLAGS += -Wl,--no-undefined
 endif
 
 # PLATFORM-SPECIFIC OPTIONS
 
-ifdef WINDOWS
+ifdef WINDOWS_TARGET
 
 else
-ifdef LINUX
+ifdef LINUX_TARGET
 
 LIBS += -lm -ldl
 
 else
-ifdef OSX
+ifdef OSX_TARGET
 
 LIBS += -lm -ldl
 
index 93e8294..e9f3d04 100644 (file)
@@ -66,6 +66,7 @@ OFLAGS =
 
 # CROSS-PLATFORM MAGIC
 
+include ../../../crossplatform.mk
 include ../../../include.mk
 
 # FLAGS
index 55e0cf2..d1e2235 100644 (file)
@@ -42,6 +42,7 @@ OFLAGS =
 
 # CROSS-PLATFORM MAGIC
 
+include ../../crossplatform.mk
 include ../../include.mk
 
 # TOOLCHAIN
@@ -70,7 +71,7 @@ LIBS = -lecere $(SHAREDLIB) $(EXECUTABLE) $(LINKOPT)
 UPXFLAGS = -9 -q
 
 # HARD CODED PLATFORM-SPECIFIC OPTIONS
-ifdef LINUX
+ifdef LINUX_TARGET
 OFLAGS += -Wl,--no-undefined
 endif
 
index 44cbace..298e71a 100644 (file)
@@ -42,6 +42,7 @@ OFLAGS =
 
 # CROSS-PLATFORM MAGIC
 
+include ../../crossplatform.mk
 include ../../include.mk
 
 # TOOLCHAIN
@@ -70,7 +71,7 @@ LIBS = -lecere $(SHAREDLIB) $(EXECUTABLE) $(LINKOPT)
 UPXFLAGS = -9 -q
 
 # HARD CODED PLATFORM-SPECIFIC OPTIONS
-ifdef LINUX
+ifdef LINUX_TARGET
 OFLAGS += -Wl,--no-undefined
 endif
 
index 87c7152..88c43c7 100644 (file)
@@ -42,6 +42,7 @@ OFLAGS =
 
 # CROSS-PLATFORM MAGIC
 
+include ../../crossplatform.mk
 include ../../include.mk
 
 # TOOLCHAIN
@@ -70,7 +71,7 @@ LIBS = -lecere $(SHAREDLIB) $(EXECUTABLE) $(LINKOPT)
 UPXFLAGS = -9 -q
 
 # HARD CODED PLATFORM-SPECIFIC OPTIONS
-ifdef LINUX
+ifdef LINUX_TARGET
 OFLAGS += -Wl,--no-undefined
 endif
 
index 603f3c4..8a054c1 100644 (file)
@@ -19,9 +19,10 @@ OFLAGS =
 
 # CROSS-PLATFORM MAGIC
 
+include ../../crossplatform.mk
 include ../../include.mk
 
-ifdef LINUX
+ifdef LINUX_TARGET
 TARGET = obj/$(CONFIG).$(PLATFORM)/$(LP)ec$(SO).0.44
 SONAME = -Wl,-soname,libec.so.0
 else
@@ -143,7 +144,7 @@ RESOURCES = \
 
 # TOOLCHAIN
 
-ifdef WINDOWS
+ifdef WINDOWS_TARGET
 else
 export LD_LIBRARY_PATH = ../../obj/$(PLATFORM)/lib/
 export DYLD_LIBRARY_PATH = ../../obj/$(PLATFORM)/lib/
@@ -174,7 +175,7 @@ LIBS = -lecere $(SHAREDLIB) $(EXECUTABLE) $(LINKOPT)
 UPXFLAGS = -9 -q
 
 # HARD CODED PLATFORM-SPECIFIC OPTIONS
-ifdef LINUX
+ifdef LINUX_TARGET
 OFLAGS += -Wl,--no-undefined
 endif
 
@@ -204,11 +205,11 @@ endif
        $(EAR) awq $(TARGET) locale/zh_CN/LC_MESSAGES/ec.mo "locale/zh_CN/LC_MESSAGES"
        $(EAR) awq $(TARGET) locale/es_ES/LC_MESSAGES/ec.mo "locale/es_ES/LC_MESSAGES"
        $(call cpq,$(TARGET),../../$(SODESTDIR))
-ifdef LINUX
+ifdef LINUX_TARGET
        ln -sf $(LP)$(MODULE)$(SO).0.44 ../../$(SODESTDIR)$(LP)$(MODULE)$(SO).0
        ln -sf $(LP)$(MODULE)$(SO).0.44 ../../$(SODESTDIR)$(LP)$(MODULE)$(SO)
 endif  
-ifdef WINDOWS
+ifdef WINDOWS_TARGET
        $(call cpq,$(TARGET),../../compiler/bootstrap/obj/bin.$(PLATFORM)/)
 endif
 
index 6d1ee34..6f0c371 100644 (file)
@@ -1,27 +1,59 @@
 # HOST PLATFORM DETECTION
 ifeq "$(OS)" "Windows_NT"
-   WINDOWS = defined
+   HOST_PLATFORM := win32
+   WINDOWS_HOST := defined
 else
 ifeq "$(OSTYPE)" "FreeBSD"
-   BSD = defined
+# tocheck: temporarily using linux when on bsd
+#   HOST_PLATFORM := bsd
+#   BSD_HOST := defined
+   HOST_PLATFORM := linux
+   LINUX_HOST := defined
 else
 ifeq "$(shell uname)" "Darwin"
-   OSX = defined
+   HOST_PLATFORM := apple
+   OSX_HOST := defined
 else
-   LINUX = defined
+   HOST_PLATFORM := linux
+   LINUX_HOST := defined
 endif
 endif
 endif
 
-# PLATFORM (TARGET)
+# TARGET_PLATFORM
+ifndef TARGET_PLATFORM
+ifdef PLATFORM
+   TARGET_PLATFORM := $(PLATFORM)
+endif
+endif
+ifndef TARGET_PLATFORM
+ifdef WINDOWS_HOST
+   TARGET_PLATFORM := win32
+else
+ifdef OSX_HOST
+   TARGET_PLATFORM := apple
+else
+ifdef BSD_HOST
+   TARGET_PLATFORM := bsd
+else
+   TARGET_PLATFORM := linux
+endif
+endif
+endif
+endif
 ifndef PLATFORM
-ifdef WINDOWS
-   PLATFORM := win32
+   PLATFORM := $(TARGET_PLATFORM)
+endif
+ifeq "$(TARGET_PLATFORM)" "win32"
+   WINDOWS_TARGET := defined
 else
-ifdef OSX
-   PLATFORM := apple
+ifeq "$(TARGET_PLATFORM)" "apple"
+   OSX_TARGET := defined
+else
+ifeq "$(TARGET_PLATFORM)" "bsd"
+   BSD_TARGET := defined
 else
-   PLATFORM := linux
+   LINUX_TARGET := defined
 endif
 endif
 endif
@@ -45,7 +77,7 @@ hidspace = $(subst $(space),\7f,$(subst \$(space),\7f,$1))
 shwspace = $(subst \7f,\$(space),$1)
 
 # PATH SEPARATOR STRING TOOLS
-ifdef WINDOWS
+ifdef WINDOWS_HOST
 ifndef MSYSCON
    WIN_PS_TOOLS := defined
 endif
@@ -69,7 +101,7 @@ B := .bowl
 C := .c
 O := .o
 A := .a
-ifeq "$(PLATFORM)" "win32"
+ifdef WINDOWS_TARGET
    E := .exe
 ifeq "$(TARGET_TYPE)" "staticlib"
    LP := lib
@@ -78,7 +110,7 @@ else
 endif
    SO := .dll
 else
-ifeq "$(PLATFORM)" "apple"
+ifdef OSX_TARGET
    E :=
    LP := lib
    SO := .dylib
@@ -102,7 +134,7 @@ endif
 endif
 
 # SHELL COMMANDS
-ifdef WINDOWS
+ifdef WINDOWS_HOST
 ifndef MSYSCON
    WIN_SHELL_COMMANDS := defined
 endif
@@ -133,7 +165,7 @@ else
    ECSLIBOPT :=
 endif
 endif
-ifdef WINDOWS
+ifdef WINDOWS_TARGET
    FVISIBILITY :=
    FPIC :=
 ifeq "$(TARGET_TYPE)" "executable"
@@ -179,17 +211,17 @@ endif
    LINKOPT :=
    STRIPOPT := -x --strip-unneeded --remove-section=.comment --remove-section=.note
 endif
-ifdef WINDOWS
-   SODESTDIR := obj/$(PLATFORM)/bin/
+ifdef WINDOWS_TARGET
+   SODESTDIR := obj/$(TARGET_PLATFORM)/bin/
 else
-   SODESTDIR := obj/$(PLATFORM)/lib/
+   SODESTDIR := obj/$(TARGET_PLATFORM)/lib/
 endif
 
 _L = $(if $(filter $(1),$(EXCLUDED_LIBS)),,-l$(1))
 
 # COMMON LIBRARIES DETECTION
 
-ifdef WINDOWS
+ifdef WINDOWS_TARGET
 
 ifdef OPENSSL_CONF
 _OPENSSL_CONF = $(call hidspace,$(call fixps,$(OPENSSL_CONF)))
@@ -197,7 +229,7 @@ OPENSSL_INCLUDE_DIR = $(call shwspace,$(subst /bin/openssl.cfg,/include,$(_OPENS
 OPENSSL_LIB_DIR = $(call shwspace,$(subst /bin/openssl.cfg,/lib,$(_OPENSSL_CONF)))
 OPENSSL_BIN_DIR = $(call shwspace,$(subst /bin/openssl.cfg,/bin,$(_OPENSSL_CONF)))
 else
-# To avoid confusion with empty -L/-I
+# to avoid issues with empty -L/-I
 OPENSSL_INCLUDE_DIR = .
 OPENSSL_LIB_DIR = .
 OPENSSL_BIN_DIR = .
index 1de82ae..3c8ba7e 100644 (file)
@@ -3,12 +3,13 @@
 
 # CROSS-PLATFORM MAGIC
 
+include ../crossplatform.mk
 include ../include.mk
 
-ifdef WINDOWS
+ifdef WINDOWS_TARGET
 all: freetype jpeg png gif ffi z
 else
-ifdef OSX
+ifdef OSX_TARGET
 all: jpeg png gif
 else
 all: gif
index 348fbf2..552bff5 100644 (file)
@@ -120,6 +120,7 @@ OFLAGS =
 
 # CROSS-PLATFORM MAGIC
 
+include ../../crossplatform.mk
 include ../../include.mk
 
 # FLAGS
@@ -137,7 +138,7 @@ LIBS = $(SHAREDLIB) $(EXECUTABLE) $(LINKOPT)
 UPXFLAGS = -9 -q
 
 # HARD CODED PLATFORM-SPECIFIC OPTIONS
-ifdef LINUX
+ifdef LINUX_TARGET
 OFLAGS += -Wl,--no-undefined
 endif
 
index d7133fd..b3e1fbc 100644 (file)
@@ -130,6 +130,7 @@ OFLAGS =
 
 # CROSS-PLATFORM MAGIC
 
+include ../../crossplatform.mk
 include ../../include.mk
 
 # FLAGS
@@ -141,7 +142,7 @@ LIBS = $(SHAREDLIB) $(EXECUTABLE) $(LINKOPT)
 UPXFLAGS = -9 -q
 
 # HARD CODED PLATFORM-SPECIFIC OPTIONS
-ifdef LINUX
+ifdef LINUX_TARGET
 OFLAGS += -Wl,--no-undefined
 endif
 
index 970e66f..684d6e4 100644 (file)
@@ -31,6 +31,7 @@ OFLAGS =
 
 # INCLUDES
 
+include ../../crossplatform.mk
 include ../../include.mk
 
 # VARIABLES
index abcc5e9..c3405fb 100644 (file)
@@ -62,6 +62,7 @@ OFLAGS =
 
 # CROSS-PLATFORM MAGIC
 
+include ../../crossplatform.mk
 include ../../include.mk
 
 # FLAGS
@@ -75,7 +76,7 @@ LIBS = $(SHAREDLIB) $(EXECUTABLE) $(LINKOPT)
 UPXFLAGS = -9 -q
 
 # HARD CODED PLATFORM-SPECIFIC OPTIONS
-ifdef LINUX
+ifdef LINUX_TARGET
 OFLAGS += -Wl,--no-undefined
 endif
 
index 4264a90..473c7f0 100644 (file)
@@ -38,6 +38,7 @@ OFLAGS =
 
 # CROSS-PLATFORM MAGIC
 
+include ../../crossplatform.mk
 include ../../include.mk
 
 # FLAGS
@@ -49,7 +50,7 @@ LIBS = $(SHAREDLIB) $(EXECUTABLE) $(LINKOPT)
 UPXFLAGS = -9 -q
 
 # HARD CODED PLATFORM-SPECIFIC OPTIONS
-ifdef LINUX
+ifdef LINUX_TARGET
 OFLAGS += -Wl,--no-undefined
 endif
 
index 475e35b..e6a3943 100644 (file)
@@ -56,6 +56,7 @@ OFLAGS =
 
 # CROSS-PLATFORM MAGIC
 
+include ../../crossplatform.mk
 include ../../include.mk
 
 # FLAGS
@@ -67,7 +68,7 @@ LIBS = $(SHAREDLIB) $(EXECUTABLE) $(LINKOPT)
 UPXFLAGS = -9 -q
 
 # HARD CODED PLATFORM-SPECIFIC OPTIONS
-ifdef LINUX
+ifdef LINUX_TARGET
 OFLAGS += -Wl,--no-undefined
 endif
 
index 921b33e..c854a4b 100644 (file)
@@ -83,6 +83,7 @@ OFLAGS =
 
 # CROSS-PLATFORM MAGIC
 
+include ../crossplatform.mk
 include ../include.mk
 
 # TOOLCHAIN
@@ -110,7 +111,7 @@ LIBS = -lecere $(SHAREDLIB) $(EXECUTABLE) $(LINKOPT)
 UPXFLAGS = -9 -q
 
 # HARD CODED PLATFORM-SPECIFIC OPTIONS
-ifdef LINUX
+ifdef LINUX_TARGET
 OFLAGS += -Wl,--no-undefined
 endif
 
index bd3f4f6..f5e040b 100644 (file)
@@ -3,6 +3,7 @@
 
 # CROSS-PLATFORM MAGIC
 
+include ../crossplatform.mk
 include ../include.mk
 
 all:
index 47e6995..909ac8e 100644 (file)
@@ -43,6 +43,7 @@ OFLAGS =
 
 # CROSS-PLATFORM MAGIC
 
+include ../../crossplatform.mk
 include ../../include.mk
 
 # TOOLCHAIN
@@ -70,7 +71,7 @@ LIBS = -lecere $(SHAREDLIB) $(EXECUTABLE) $(LINKOPT)
 UPXFLAGS = -9 -q
 
 # HARD CODED PLATFORM-SPECIFIC OPTIONS
-ifdef LINUX
+ifdef LINUX_TARGET
 OFLAGS += -Wl,--no-undefined
 endif
 
index cf91cdf..0ca2a5b 100644 (file)
@@ -70,6 +70,7 @@ OFLAGS =
 
 # CROSS-PLATFORM MAGIC
 
+include ../../crossplatform.mk
 include ../../include.mk
 
 # TOOLCHAIN
@@ -98,18 +99,18 @@ LIBS = -lecereVanilla -lz $(SHAREDLIB) $(EXECUTABLE) $(LINKOPT)
 UPXFLAGS = -9 -q --no-progress --no-color
 
 # HARD CODED PLATFORM-SPECIFIC OPTIONS
-ifdef LINUX
+ifdef LINUX_TARGET
 OFLAGS += -Wl,--no-undefined
 endif
 
 # PLATFORM-SPECIFIC OPTIONS
 
-ifdef WINDOWS
+ifdef WINDOWS_TARGET
 
 LIBS += -lmpr -lwinmm -limm32
 
 else
-ifdef LINUX
+ifdef LINUX_TARGET
 
 OFLAGS += \
         -L/usr/X11R6/lib
@@ -117,7 +118,7 @@ OFLAGS += \
 LIBS += -lfontconfig -lfreetype -lXrender -lXext -lncurses -lm -ldl -lpthread -lX11
 
 else
-ifdef OSX
+ifdef OSX_TARGET
 
 OFLAGS += \
         -L/usr/X11R6/lib
@@ -149,7 +150,7 @@ $(TARGET): $(SOURCES) $(RESOURCES) $(SYMBOLS) $(OBJECTS) | objdir
 ifndef NOSTRIP
        $(STRIP) $(STRIPOPT) $(TARGET)
 endif
-ifndef WINDOWS
+ifndef WINDOWS_TARGET
 ifeq "$(TARGET_TYPE)" "executable"
        @-$(call psep,$(UPX) $(UPXFLAGS) $(TARGET)) || $(call echo,upx not installed; not compressing.)
 endif
index 86e4676..bb06f10 100644 (file)
@@ -18,9 +18,10 @@ OFLAGS =
 
 # CROSS-PLATFORM MAGIC
 
+include ../crossplatform.mk
 include ../include.mk
 
-ifdef LINUX
+ifdef LINUX_TARGET
 TARGET = obj/$(CONFIG).$(PLATFORM)/$(LP)$(MODULE)$(SO).0.44
 SONAME = -Wl,-soname,libecere.so.0
 else
@@ -90,20 +91,20 @@ OBJECTS2 = \
        $(OBJ)harfbuzz-tibetan.o \
        $(OBJ)harfbuzz-impl.o \
        $(OBJ)harfbuzz-thai.o \
-       $(if $(WINDOWS),$(OBJ)Direct3D8DisplayDriver.o,) \
-       $(if $(WINDOWS),$(OBJ)Direct3D9DisplayDriver.o,) \
-       $(if $(WINDOWS),$(OBJ)DirectDrawDisplayDriver.o,) \
-       $(if $(WINDOWS),$(OBJ)GDIDisplayDriver.o,) \
+       $(if $(WINDOWS_TARGET),$(OBJ)Direct3D8DisplayDriver.o,) \
+       $(if $(WINDOWS_TARGET),$(OBJ)Direct3D9DisplayDriver.o,) \
+       $(if $(WINDOWS_TARGET),$(OBJ)DirectDrawDisplayDriver.o,) \
+       $(if $(WINDOWS_TARGET),$(OBJ)GDIDisplayDriver.o,) \
        $(OBJ)lfbBlit.o \
        $(OBJ)lfbConvert.o \
        $(OBJ)LFBDisplayDriver.o \
-       $(if $(or $(LINUX),$(OSX)),$(OBJ)NCursesDisplayDriver.o,) \
-       $(if $(OSX),,$(OBJ)OpenGLDisplayDriver.o) \
-       $(if $(WINDOWS),$(OBJ)Win32BitmapPrinterDisplayDriver.o,) \
+       $(if $(or $(LINUX_TARGET),$(OSX_TARGET)),$(OBJ)NCursesDisplayDriver.o,) \
+       $(if $(OSX_TARGET),,$(OBJ)OpenGLDisplayDriver.o) \
+       $(if $(WINDOWS_TARGET),$(OBJ)Win32BitmapPrinterDisplayDriver.o,) \
        $(if $(OSX),$(OBJ)CocoaOpenGLDisplayDriver.o,) \
-       $(if $(WINDOWS),$(OBJ)Win32ConsoleDisplayDriver.o,) \
-       $(if $(WINDOWS),$(OBJ)Win32PrinterDisplayDriver.o,) \
-       $(if $(LINUX),$(OBJ)XDisplayDriver.o,) \
+       $(if $(WINDOWS_TARGET),$(OBJ)Win32ConsoleDisplayDriver.o,) \
+       $(if $(WINDOWS_TARGET),$(OBJ)Win32PrinterDisplayDriver.o,) \
+       $(if $(LINUX_TARGET),$(OBJ)XDisplayDriver.o,) \
        $(OBJ)Bitmap.o \
        $(OBJ)BitmapResource.o \
        $(OBJ)Color.o \
@@ -138,14 +139,14 @@ OBJECTS3 = \
        $(OBJ)MessageBox.o \
        $(OBJ)ReplaceDialog.o \
        $(OBJ)WindowList.o \
-       $(if $(OSX),$(OBJ)CocoaDispatch.o,) \
-       $(if $(OSX),$(OBJ)CocoaEcereBridge.o,) \
-       $(if $(OSX),$(OBJ)CocoaInterface.o,) \
-       $(if $(OSX),$(OBJ)EcereView.o,) \
-       $(if $(or $(LINUX),$(OSX)),$(OBJ)NCursesInterface.o,) \
-       $(if $(WINDOWS),$(OBJ)Win32Interface.o,) \
-       $(if $(WINDOWS),$(OBJ)Win32ConsoleInterface.o,) \
-       $(if $(or $(LINUX),$(OSX)),$(OBJ)XInterface.o,) \
+       $(if $(OSX_TARGET),$(OBJ)CocoaDispatch.o,) \
+       $(if $(OSX_TARGET),$(OBJ)CocoaEcereBridge.o,) \
+       $(if $(OSX_TARGET),$(OBJ)CocoaInterface.o,) \
+       $(if $(OSX_TARGET),$(OBJ)EcereView.o,) \
+       $(if $(or $(LINUX_TARGET),$(OSX_TARGET)),$(OBJ)NCursesInterface.o,) \
+       $(if $(WINDOWS_TARGET),$(OBJ)Win32Interface.o,) \
+       $(if $(WINDOWS_TARGET),$(OBJ)Win32ConsoleInterface.o,) \
+       $(if $(or $(LINUX_TARGET),$(OSX_TARGET)),$(OBJ)XInterface.o,) \
        $(OBJ)TVisionSkin.o \
        $(OBJ)WindowsSkin.o \
        $(OBJ)Anchor.o \
@@ -223,21 +224,21 @@ COBJECTS1 = \
        $(OBJ)PCXFormat.c \
        $(OBJ)PNGFormat.c \
        $(OBJ)RGBFormat.c \
-       $(if $(WINDOWS),$(OBJ)Direct3D8DisplayDriver.c,) \
-       $(if $(WINDOWS),$(OBJ)Direct3D9DisplayDriver.c,) \
-       $(if $(WINDOWS),$(OBJ)DirectDrawDisplayDriver.c,) \
-       $(if $(WINDOWS),$(OBJ)GDIDisplayDriver.c,) \
+       $(if $(WINDOWS_TARGET),$(OBJ)Direct3D8DisplayDriver.c,) \
+       $(if $(WINDOWS_TARGET),$(OBJ)Direct3D9DisplayDriver.c,) \
+       $(if $(WINDOWS_TARGET),$(OBJ)DirectDrawDisplayDriver.c,) \
+       $(if $(WINDOWS_TARGET),$(OBJ)GDIDisplayDriver.c,) \
        $(OBJ)lfbBlit.c \
        $(OBJ)lfbConvert.c \
        $(OBJ)LFBDisplayDriver.c \
-       $(if $(or $(LINUX),$(OSX)),$(OBJ)NCursesDisplayDriver.c,)
+       $(if $(or $(LINUX_TARGET),$(OSX_TARGET)),$(OBJ)NCursesDisplayDriver.c,)
 COBJECTS2 = \
-       $(if $(OSX),,$(OBJ)OpenGLDisplayDriver.c) \
-       $(if $(WINDOWS),$(OBJ)Win32BitmapPrinterDisplayDriver.c,) \
-       $(if $(OSX),$(OBJ)CocoaOpenGLDisplayDriver.c,) \
-       $(if $(WINDOWS),$(OBJ)Win32ConsoleDisplayDriver.c,) \
-       $(if $(WINDOWS),$(OBJ)Win32PrinterDisplayDriver.c,) \
-       $(if $(LINUX),$(OBJ)XDisplayDriver.c,) \
+       $(if $(OSX_TARGET),,$(OBJ)OpenGLDisplayDriver.c) \
+       $(if $(WINDOWS_TARGET),$(OBJ)Win32BitmapPrinterDisplayDriver.c,) \
+       $(if $(OSX_TARGET),$(OBJ)CocoaOpenGLDisplayDriver.c,) \
+       $(if $(WINDOWS_TARGET),$(OBJ)Win32ConsoleDisplayDriver.c,) \
+       $(if $(WINDOWS_TARGET),$(OBJ)Win32PrinterDisplayDriver.c,) \
+       $(if $(LINUX_TARGET),$(OBJ)XDisplayDriver.c,) \
        $(OBJ)Bitmap.c \
        $(OBJ)BitmapResource.c \
        $(OBJ)Color.c \
@@ -271,13 +272,13 @@ COBJECTS2 = \
        $(OBJ)MessageBox.c \
        $(OBJ)ReplaceDialog.c \
        $(OBJ)WindowList.c \
-       $(if $(OSX),$(OBJ)CocoaDispatch.c,)
+       $(if $(OSX_TARGET),$(OBJ)CocoaDispatch.c,)
 COBJECTS3 = \
-       $(if $(OSX),$(OBJ)CocoaInterface.c,) \
-       $(if $(or $(LINUX),$(OSX)),$(OBJ)NCursesInterface.c,) \
-       $(if $(WINDOWS),$(OBJ)Win32Interface.c,) \
-       $(if $(WINDOWS),$(OBJ)Win32ConsoleInterface.c,) \
-       $(if $(or $(LINUX),$(OSX)),$(OBJ)XInterface.c,) \
+       $(if $(OSX_TARGET),$(OBJ)CocoaInterface.c,) \
+       $(if $(or $(LINUX_TARGET),$(OSX_TARGET)),$(OBJ)NCursesInterface.c,) \
+       $(if $(WINDOWS_TARGET),$(OBJ)Win32Interface.c,) \
+       $(if $(WINDOWS_TARGET),$(OBJ)Win32ConsoleInterface.c,) \
+       $(if $(or $(LINUX_TARGET),$(OSX_TARGET)),$(OBJ)XInterface.c,) \
        $(OBJ)TVisionSkin.c \
        $(OBJ)WindowsSkin.c \
        $(OBJ)Anchor.c \
@@ -352,21 +353,21 @@ SYMBOLS1 = \
        $(OBJ)PCXFormat.sym \
        $(OBJ)PNGFormat.sym \
        $(OBJ)RGBFormat.sym \
-       $(if $(WINDOWS),$(OBJ)Direct3D8DisplayDriver.sym,) \
-       $(if $(WINDOWS),$(OBJ)Direct3D9DisplayDriver.sym,) \
-       $(if $(WINDOWS),$(OBJ)DirectDrawDisplayDriver.sym,) \
-       $(if $(WINDOWS),$(OBJ)GDIDisplayDriver.sym,) \
+       $(if $(WINDOWS_TARGET),$(OBJ)Direct3D8DisplayDriver.sym,) \
+       $(if $(WINDOWS_TARGET),$(OBJ)Direct3D9DisplayDriver.sym,) \
+       $(if $(WINDOWS_TARGET),$(OBJ)DirectDrawDisplayDriver.sym,) \
+       $(if $(WINDOWS_TARGET),$(OBJ)GDIDisplayDriver.sym,) \
        $(OBJ)lfbBlit.sym \
        $(OBJ)lfbConvert.sym \
        $(OBJ)LFBDisplayDriver.sym
 SYMBOLS2 = \
-       $(if $(or $(LINUX),$(OSX)),$(OBJ)NCursesDisplayDriver.sym,) \
-       $(if $(OSX),,$(OBJ)OpenGLDisplayDriver.sym) \
-       $(if $(WINDOWS),$(OBJ)Win32BitmapPrinterDisplayDriver.sym,) \
-       $(if $(OSX),$(OBJ)CocoaOpenGLDisplayDriver.sym,) \
-       $(if $(WINDOWS),$(OBJ)Win32ConsoleDisplayDriver.sym,) \
-       $(if $(WINDOWS),$(OBJ)Win32PrinterDisplayDriver.sym,) \
-       $(if $(LINUX),$(OBJ)XDisplayDriver.sym,) \
+       $(if $(or $(LINUX_TARGET),$(OSX_TARGET)),$(OBJ)NCursesDisplayDriver.sym,) \
+       $(if $(OSX_TARGET),,$(OBJ)OpenGLDisplayDriver.sym) \
+       $(if $(WINDOWS_TARGET),$(OBJ)Win32BitmapPrinterDisplayDriver.sym,) \
+       $(if $(OSX_TARGET),$(OBJ)CocoaOpenGLDisplayDriver.sym,) \
+       $(if $(WINDOWS_TARGET),$(OBJ)Win32ConsoleDisplayDriver.sym,) \
+       $(if $(WINDOWS_TARGET),$(OBJ)Win32PrinterDisplayDriver.sym,) \
+       $(if $(LINUX_TARGET),$(OBJ)XDisplayDriver.sym,) \
        $(OBJ)Bitmap.sym \
        $(OBJ)BitmapResource.sym \
        $(OBJ)Color.sym \
@@ -401,12 +402,12 @@ SYMBOLS3 = \
        $(OBJ)MessageBox.sym \
        $(OBJ)ReplaceDialog.sym \
        $(OBJ)WindowList.sym \
-       $(if $(OSX),$(OBJ)CocoaDispatch.sym,) \
-       $(if $(OSX),$(OBJ)CocoaInterface.sym,) \
-       $(if $(or $(LINUX),$(OSX)),$(OBJ)NCursesInterface.sym,) \
-       $(if $(WINDOWS),$(OBJ)Win32Interface.sym,) \
-       $(if $(WINDOWS),$(OBJ)Win32ConsoleInterface.sym,) \
-       $(if $(or $(LINUX),$(OSX)),$(OBJ)XInterface.sym,) \
+       $(if $(OSX_TARGET),$(OBJ)CocoaDispatch.sym,) \
+       $(if $(OSX_TARGET),$(OBJ)CocoaInterface.sym,) \
+       $(if $(or $(LINUX_TARGET),$(OSX_TARGET)),$(OBJ)NCursesInterface.sym,) \
+       $(if $(WINDOWS_TARGET),$(OBJ)Win32Interface.sym,) \
+       $(if $(WINDOWS_TARGET),$(OBJ)Win32ConsoleInterface.sym,) \
+       $(if $(or $(LINUX_TARGET),$(OSX_TARGET)),$(OBJ)XInterface.sym,) \
        $(OBJ)TVisionSkin.sym \
        $(OBJ)WindowsSkin.sym \
        $(OBJ)Anchor.sym \
@@ -482,21 +483,21 @@ IMPORTS1 = \
        $(OBJ)PCXFormat.imp \
        $(OBJ)PNGFormat.imp \
        $(OBJ)RGBFormat.imp \
-       $(if $(WINDOWS),$(OBJ)Direct3D8DisplayDriver.imp,) \
-       $(if $(WINDOWS),$(OBJ)Direct3D9DisplayDriver.imp,) \
-       $(if $(WINDOWS),$(OBJ)DirectDrawDisplayDriver.imp,) \
-       $(if $(WINDOWS),$(OBJ)GDIDisplayDriver.imp,) \
+       $(if $(WINDOWS_TARGET),$(OBJ)Direct3D8DisplayDriver.imp,) \
+       $(if $(WINDOWS_TARGET),$(OBJ)Direct3D9DisplayDriver.imp,) \
+       $(if $(WINDOWS_TARGET),$(OBJ)DirectDrawDisplayDriver.imp,) \
+       $(if $(WINDOWS_TARGET),$(OBJ)GDIDisplayDriver.imp,) \
        $(OBJ)lfbBlit.imp \
        $(OBJ)lfbConvert.imp \
        $(OBJ)LFBDisplayDriver.imp
 IMPORTS2 = \
-       $(if $(or $(LINUX),$(OSX)),$(OBJ)NCursesDisplayDriver.imp,) \
-       $(if $(OSX),,$(OBJ)OpenGLDisplayDriver.imp) \
-       $(if $(WINDOWS),$(OBJ)Win32BitmapPrinterDisplayDriver.imp,) \
-       $(if $(OSX),$(OBJ)CocoaOpenGLDisplayDriver.imp,) \
-       $(if $(WINDOWS),$(OBJ)Win32ConsoleDisplayDriver.imp,) \
-       $(if $(WINDOWS),$(OBJ)Win32PrinterDisplayDriver.imp,) \
-       $(if $(LINUX),$(OBJ)XDisplayDriver.imp,) \
+       $(if $(or $(LINUX_TARGET),$(OSX_TARGET)),$(OBJ)NCursesDisplayDriver.imp,) \
+       $(if $(OSX_TARGET),,$(OBJ)OpenGLDisplayDriver.imp) \
+       $(if $(WINDOWS_TARGET),$(OBJ)Win32BitmapPrinterDisplayDriver.imp,) \
+       $(if $(OSX_TARGET),$(OBJ)CocoaOpenGLDisplayDriver.imp,) \
+       $(if $(WINDOWS_TARGET),$(OBJ)Win32ConsoleDisplayDriver.imp,) \
+       $(if $(WINDOWS_TARGET),$(OBJ)Win32PrinterDisplayDriver.imp,) \
+       $(if $(LINUX_TARGET),$(OBJ)XDisplayDriver.imp,) \
        $(OBJ)Bitmap.imp \
        $(OBJ)BitmapResource.imp \
        $(OBJ)Color.imp \
@@ -531,12 +532,12 @@ IMPORTS3 = \
        $(OBJ)MessageBox.imp \
        $(OBJ)ReplaceDialog.imp \
        $(OBJ)WindowList.imp \
-       $(if $(OSX),$(OBJ)CocoaDispatch.imp,) \
-       $(if $(OSX),$(OBJ)CocoaInterface.imp,) \
-       $(if $(or $(LINUX),$(OSX)),$(OBJ)NCursesInterface.imp,) \
-       $(if $(WINDOWS),$(OBJ)Win32Interface.imp,) \
-       $(if $(WINDOWS),$(OBJ)Win32ConsoleInterface.imp,) \
-       $(if $(or $(LINUX),$(OSX)),$(OBJ)XInterface.imp,) \
+       $(if $(OSX_TARGET),$(OBJ)CocoaDispatch.imp,) \
+       $(if $(OSX_TARGET),$(OBJ)CocoaInterface.imp,) \
+       $(if $(or $(LINUX_TARGET),$(OSX_TARGET)),$(OBJ)NCursesInterface.imp,) \
+       $(if $(WINDOWS_TARGET),$(OBJ)Win32Interface.imp,) \
+       $(if $(WINDOWS_TARGET),$(OBJ)Win32ConsoleInterface.imp,) \
+       $(if $(or $(LINUX_TARGET),$(OSX_TARGET)),$(OBJ)XInterface.imp,) \
        $(OBJ)TVisionSkin.imp \
        $(OBJ)WindowsSkin.imp \
        $(OBJ)Anchor.imp \
@@ -635,20 +636,20 @@ SOURCES2 = \
        src/gfx/drivers/harfbuzz/harfbuzz-tibetan.c \
        src/gfx/drivers/harfbuzz/harfbuzz-impl.c \
        src/gfx/drivers/harfbuzz/harfbuzz-thai.c \
-       $(if $(WINDOWS),src/gfx/drivers/Direct3D8DisplayDriver.ec,) \
-       $(if $(WINDOWS),src/gfx/drivers/Direct3D9DisplayDriver.ec,) \
-       $(if $(WINDOWS),src/gfx/drivers/DirectDrawDisplayDriver.ec,) \
-       $(if $(WINDOWS),src/gfx/drivers/GDIDisplayDriver.ec,) \
+       $(if $(WINDOWS_TARGET),src/gfx/drivers/Direct3D8DisplayDriver.ec,) \
+       $(if $(WINDOWS_TARGET),src/gfx/drivers/Direct3D9DisplayDriver.ec,) \
+       $(if $(WINDOWS_TARGET),src/gfx/drivers/DirectDrawDisplayDriver.ec,) \
+       $(if $(WINDOWS_TARGET),src/gfx/drivers/GDIDisplayDriver.ec,) \
        src/gfx/drivers/lfbBlit.ec \
        src/gfx/drivers/lfbConvert.ec \
        src/gfx/drivers/LFBDisplayDriver.ec \
-       $(if $(or $(LINUX),$(OSX)),src/gfx/drivers/NCursesDisplayDriver.ec,) \
-       $(if $(OSX),,src/gfx/drivers/OpenGLDisplayDriver.ec) \
-       $(if $(WINDOWS),src/gfx/drivers/Win32BitmapPrinterDisplayDriver.ec,) \
-       $(if $(OSX),src/gfx/drivers/CocoaOpenGLDisplayDriver.ec,) \
-       $(if $(WINDOWS),src/gfx/drivers/Win32ConsoleDisplayDriver.ec,) \
-       $(if $(WINDOWS),src/gfx/drivers/Win32PrinterDisplayDriver.ec,) \
-       $(if $(LINUX),src/gfx/drivers/XDisplayDriver.ec,) \
+       $(if $(or $(LINUX_TARGET),$(OSX_TARGET)),src/gfx/drivers/NCursesDisplayDriver.ec,) \
+       $(if $(OSX_TARGET),,src/gfx/drivers/OpenGLDisplayDriver.ec) \
+       $(if $(WINDOWS_TARGET),src/gfx/drivers/Win32BitmapPrinterDisplayDriver.ec,) \
+       $(if $(OSX_TARGET),src/gfx/drivers/CocoaOpenGLDisplayDriver.ec,) \
+       $(if $(WINDOWS_TARGET),src/gfx/drivers/Win32ConsoleDisplayDriver.ec,) \
+       $(if $(WINDOWS_TARGET),src/gfx/drivers/Win32PrinterDisplayDriver.ec,) \
+       $(if $(LINUX_TARGET),src/gfx/drivers/XDisplayDriver.ec,) \
        src/gfx/Bitmap.ec \
        src/gfx/BitmapResource.ec \
        src/gfx/Color.ec \
@@ -683,14 +684,14 @@ SOURCES3 = \
        src/gui/dialogs/MessageBox.ec \
        src/gui/dialogs/ReplaceDialog.ec \
        src/gui/dialogs/WindowList.ec \
-       $(if $(OSX),src/gui/drivers/cocoa/CocoaDispatch.ec,) \
-       $(if $(OSX),src/gui/drivers/cocoa/CocoaEcereBridge.m,) \
-       $(if $(OSX),src/gui/drivers/cocoa/CocoaInterface.ec,) \
-       $(if $(OSX),src/gui/drivers/cocoa/EcereView.m,) \
-       $(if $(or $(LINUX),$(OSX)),src/gui/drivers/NCursesInterface.ec,) \
-       $(if $(WINDOWS),src/gui/drivers/Win32Interface.ec,) \
-       $(if $(WINDOWS),src/gui/drivers/Win32ConsoleInterface.ec,) \
-       $(if $(or $(LINUX),$(OSX)),src/gui/drivers/XInterface.ec,) \
+       $(if $(OSX_TARGET),src/gui/drivers/cocoa/CocoaDispatch.ec,) \
+       $(if $(OSX_TARGET),src/gui/drivers/cocoa/CocoaEcereBridge.m,) \
+       $(if $(OSX_TARGET),src/gui/drivers/cocoa/CocoaInterface.ec,) \
+       $(if $(OSX_TARGET),src/gui/drivers/cocoa/EcereView.m,) \
+       $(if $(or $(LINUX_TARGET),$(OSX_TARGET)),src/gui/drivers/NCursesInterface.ec,) \
+       $(if $(WINDOWS_TARGET),src/gui/drivers/Win32Interface.ec,) \
+       $(if $(WINDOWS_TARGET),src/gui/drivers/Win32ConsoleInterface.ec,) \
+       $(if $(or $(LINUX_TARGET),$(OSX_TARGET)),src/gui/drivers/XInterface.ec,) \
        src/gui/skins/TVisionSkin.ec \
        src/gui/skins/WindowsSkin.ec \
        src/gui/Anchor.ec \
@@ -860,7 +861,7 @@ LIBS = -ljpeg -lpng -lz -lfreetype $(SHAREDLIB) $(EXECUTABLE) $(LINKOPT)
 UPXFLAGS = -9 -q
 
 # HARD CODED PLATFORM-SPECIFIC OPTIONS
-ifdef LINUX
+ifdef LINUX_TARGET
 OFLAGS += -Wl,--no-undefined
 endif
 
@@ -870,7 +871,7 @@ endif
 
 # PLATFORM-SPECIFIC OPTIONS
 
-ifdef WINDOWS
+ifdef WINDOWS_TARGET
 
 CFLAGS += \
         -isystem ../deps/glext \
@@ -891,7 +892,7 @@ OFLAGS += \
 LIBS += -ldxguid -lddraw -ldinput -lwinmm -lopengl32 -lws2_32 -lkernel32 -luser32 -lgdi32 -lmpr -ladvapi32 -lshell32 -lwinspool -limm32 -lungif
 
 else
-ifdef LINUX
+ifdef LINUX_TARGET
 
 CFLAGS += \
         -I/usr/include/freetype2 \
@@ -904,7 +905,7 @@ OFLAGS += \
 LIBS += -lncurses -lpthread -lm -ldl -lfontconfig -lungif -lX11 -lXext -lXrender -lGL
 
 else
-ifdef OSX
+ifdef OSX_TARGET
 
 CFLAGS += \
         -I/usr/include/freetype2 \
@@ -948,11 +949,11 @@ nores: $(SOURCES) $(RESOURCES) $(SYMBOLS) $(OBJECTS) | objdir
 ifndef NOSTRIP
        $(STRIP) $(STRIPOPT) $(TARGET)
 endif
-ifdef WINDOWS
+ifdef WINDOWS_TARGET
        $(call cpq,$(TARGET),../compiler/bootstrap/obj/bin.$(PLATFORM)/)
 endif
        $(call cpq,$(TARGET),../$(SODESTDIR))
-ifdef LINUX
+ifdef LINUX_TARGET
        ln -sf $(LP)$(MODULE)$(SO).0.44 ../$(SODESTDIR)$(LP)$(MODULE)$(SO).0
        ln -sf $(LP)$(MODULE)$(SO).0.44 ../$(SODESTDIR)$(LP)$(MODULE)$(SO)
 endif  
@@ -982,7 +983,7 @@ endif
        $(EAR) awq $(TARGET) locale/zh_CN/LC_MESSAGES/ecere.mo "locale/zh_CN/LC_MESSAGES"
        $(EAR) awq $(TARGET) locale/es_ES/LC_MESSAGES/ecere.mo "locale/es_ES/LC_MESSAGES"
        $(call cpq,$(TARGET),../$(SODESTDIR))
-ifdef LINUX
+ifdef LINUX_TARGET
        ln -sf $(LP)$(MODULE)$(SO).0.44 ../$(SODESTDIR)$(LP)$(MODULE)$(SO).0
        ln -sf $(LP)$(MODULE)$(SO).0.44 ../$(SODESTDIR)$(LP)$(MODULE)$(SO)
 endif  
index 027f8d1..ae4bf43 100644 (file)
@@ -18,9 +18,10 @@ OFLAGS =
 
 # CROSS-PLATFORM MAGIC
 
+include ../crossplatform.mk
 include ../include.mk
 
-ifdef LINUX
+ifdef LINUX_TARGET
 TARGET = obj/$(MODULE).$(CONFIG).$(PLATFORM)/$(LP)ecereCOM$(SO).0.44
 SONAME = -Wl,-soname,libecereCOM.so.0
 else
@@ -146,13 +147,13 @@ LIBS = $(SHAREDLIB) $(EXECUTABLE) $(LINKOPT)
 UPXFLAGS = -9 -q
 
 # HARD CODED PLATFORM-SPECIFIC OPTIONS
-ifdef LINUX
+ifdef LINUX_TARGET
 OFLAGS += -Wl,--no-undefined
 endif
 
 # PLATFORM-SPECIFIC OPTIONS
 
-ifdef LINUX
+ifdef LINUX_TARGET
 
 LIBS += -ldl -lm -lpthread
 
@@ -180,7 +181,7 @@ ifndef NOSTRIP
        $(STRIP) $(STRIPOPT) $(TARGET)
 endif
        $(call cpq,$(TARGET),../$(SODESTDIR))
-ifdef LINUX
+ifdef LINUX_TARGET
        ln -sf $(LP)$(MODULE)$(SO).0.44 ../$(SODESTDIR)$(LP)$(MODULE)$(SO).0
        ln -sf $(LP)$(MODULE)$(SO).0.44 ../$(SODESTDIR)$(LP)$(MODULE)$(SO)
 endif
index d19e473..4b1811b 100644 (file)
@@ -39,33 +39,33 @@ OBJECTS1 = \
        $(OBJ)System.c.o \
        $(OBJ)i18n.o \
        $(OBJ)BMPFormat.o \
-       $(if $(WINDOWS),,$(OBJ)harfbuzz-freetype.o) \
-       $(if $(WINDOWS),,$(OBJ)harfbuzz-unicode-tables.o) \
-       $(if $(WINDOWS),,$(OBJ)harfbuzz-unicode.o) \
-       $(if $(WINDOWS),,$(OBJ)harfbuzz-arabic.o) \
-       $(if $(WINDOWS),,$(OBJ)harfbuzz-buffer.o) \
-       $(if $(WINDOWS),,$(OBJ)harfbuzz-gdef.o) \
-       $(if $(WINDOWS),,$(OBJ)harfbuzz-gpos.o) \
-       $(if $(WINDOWS),,$(OBJ)harfbuzz-gsub.o) \
-       $(if $(WINDOWS),,$(OBJ)harfbuzz-hangul.o) \
-       $(if $(WINDOWS),,$(OBJ)harfbuzz-hebrew.o) \
-       $(if $(WINDOWS),,$(OBJ)harfbuzz-indic.o) \
-       $(if $(WINDOWS),,$(OBJ)harfbuzz-khmer.o) \
-       $(if $(WINDOWS),,$(OBJ)harfbuzz-myanmar.o) \
-       $(if $(WINDOWS),,$(OBJ)harfbuzz-open.o)
+       $(if $(WINDOWS_TARGET),,$(OBJ)harfbuzz-freetype.o) \
+       $(if $(WINDOWS_TARGET),,$(OBJ)harfbuzz-unicode-tables.o) \
+       $(if $(WINDOWS_TARGET),,$(OBJ)harfbuzz-unicode.o) \
+       $(if $(WINDOWS_TARGET),,$(OBJ)harfbuzz-arabic.o) \
+       $(if $(WINDOWS_TARGET),,$(OBJ)harfbuzz-buffer.o) \
+       $(if $(WINDOWS_TARGET),,$(OBJ)harfbuzz-gdef.o) \
+       $(if $(WINDOWS_TARGET),,$(OBJ)harfbuzz-gpos.o) \
+       $(if $(WINDOWS_TARGET),,$(OBJ)harfbuzz-gsub.o) \
+       $(if $(WINDOWS_TARGET),,$(OBJ)harfbuzz-hangul.o) \
+       $(if $(WINDOWS_TARGET),,$(OBJ)harfbuzz-hebrew.o) \
+       $(if $(WINDOWS_TARGET),,$(OBJ)harfbuzz-indic.o) \
+       $(if $(WINDOWS_TARGET),,$(OBJ)harfbuzz-khmer.o) \
+       $(if $(WINDOWS_TARGET),,$(OBJ)harfbuzz-myanmar.o) \
+       $(if $(WINDOWS_TARGET),,$(OBJ)harfbuzz-open.o)
 OBJECTS2 = \
-       $(if $(WINDOWS),,$(OBJ)harfbuzz-shaper.o) \
-       $(if $(WINDOWS),,$(OBJ)harfbuzz-stream.o) \
-       $(if $(WINDOWS),,$(OBJ)harfbuzz-tibetan.o) \
-       $(if $(WINDOWS),,$(OBJ)harfbuzz-impl.o) \
-       $(if $(WINDOWS),,$(OBJ)harfbuzz-thai.o) \
-       $(if $(WINDOWS),$(OBJ)GDIDisplayDriver.o,) \
+       $(if $(WINDOWS_TARGET),,$(OBJ)harfbuzz-shaper.o) \
+       $(if $(WINDOWS_TARGET),,$(OBJ)harfbuzz-stream.o) \
+       $(if $(WINDOWS_TARGET),,$(OBJ)harfbuzz-tibetan.o) \
+       $(if $(WINDOWS_TARGET),,$(OBJ)harfbuzz-impl.o) \
+       $(if $(WINDOWS_TARGET),,$(OBJ)harfbuzz-thai.o) \
+       $(if $(WINDOWS_TARGET),$(OBJ)GDIDisplayDriver.o,) \
        $(OBJ)lfbBlit.o \
        $(OBJ)lfbConvert.o \
        $(OBJ)LFBDisplayDriver.o \
-       $(if $(or $(LINUX),$(OSX)),$(OBJ)NCursesDisplayDriver.o,) \
-       $(if $(OSX),$(OBJ)CocoaOpenGLDisplayDriver.o,) \
-       $(if $(LINUX),$(OBJ)XDisplayDriver.o,) \
+       $(if $(or $(LINUX_TARGET),$(OSX_TARGET)),$(OBJ)NCursesDisplayDriver.o,) \
+       $(if $(OSX_TARGET),$(OBJ)CocoaOpenGLDisplayDriver.o,) \
+       $(if $(LINUX_TARGET),$(OBJ)XDisplayDriver.o,) \
        $(OBJ)Bitmap.o \
        $(OBJ)BitmapResource.o \
        $(OBJ)Color.o \
@@ -98,13 +98,13 @@ OBJECTS3 = \
        $(OBJ)MessageBox.o \
        $(OBJ)ReplaceDialog.o \
        $(OBJ)WindowList.o \
-       $(if $(OSX),$(OBJ)CocoaDispatch.o,) \
-       $(if $(OSX),$(OBJ)CocoaEcereBridge.o,) \
-       $(if $(OSX),$(OBJ)CocoaInterface.o,) \
-       $(if $(OSX),$(OBJ)EcereView.o,) \
-       $(if $(or $(LINUX),$(OSX)),$(OBJ)NCursesInterface.o,) \
-       $(if $(WINDOWS),$(OBJ)Win32Interface.o,) \
-       $(if $(or $(LINUX),$(OSX)),$(OBJ)XInterface.o,) \
+       $(if $(OSX_TARGET),$(OBJ)CocoaDispatch.o,) \
+       $(if $(OSX_TARGET),$(OBJ)CocoaEcereBridge.o,) \
+       $(if $(OSX_TARGET),$(OBJ)CocoaInterface.o,) \
+       $(if $(OSX_TARGET),$(OBJ)EcereView.o,) \
+       $(if $(or $(LINUX_TARGET),$(OSX_TARGET)),$(OBJ)NCursesInterface.o,) \
+       $(if $(WINDOWS_TARGET),$(OBJ)Win32Interface.o,) \
+       $(if $(or $(LINUX_TARGET),$(OSX_TARGET)),$(OBJ)XInterface.o,) \
        $(OBJ)WindowsSkin.o \
        $(OBJ)Anchor.o \
        $(OBJ)ClipBoard.o \
@@ -157,13 +157,13 @@ COBJECTS1 = \
        $(OBJ)units.c \
        $(OBJ)i18n.c \
        $(OBJ)BMPFormat.c \
-       $(if $(WINDOWS),$(OBJ)GDIDisplayDriver.c,) \
+       $(if $(WINDOWS_TARGET),$(OBJ)GDIDisplayDriver.c,) \
        $(OBJ)lfbBlit.c \
        $(OBJ)lfbConvert.c \
        $(OBJ)LFBDisplayDriver.c \
-       $(if $(or $(LINUX),$(OSX)),$(OBJ)NCursesDisplayDriver.c,) \
-       $(if $(OSX),$(OBJ)CocoaOpenGLDisplayDriver.c,) \
-       $(if $(LINUX),$(OBJ)XDisplayDriver.c,) \
+       $(if $(or $(LINUX_TARGET),$(OSX_TARGET)),$(OBJ)NCursesDisplayDriver.c,) \
+       $(if $(OSX_TARGET),$(OBJ)CocoaOpenGLDisplayDriver.c,) \
+       $(if $(LINUX_TARGET),$(OBJ)XDisplayDriver.c,) \
        $(OBJ)Bitmap.c \
        $(OBJ)BitmapResource.c \
        $(OBJ)Color.c \
@@ -196,11 +196,11 @@ COBJECTS2 = \
        $(OBJ)MessageBox.c \
        $(OBJ)ReplaceDialog.c \
        $(OBJ)WindowList.c \
-       $(if $(OSX),$(OBJ)CocoaDispatch.c,) \
-       $(if $(OSX),$(OBJ)CocoaInterface.c,) \
-       $(if $(or $(LINUX),$(OSX)),$(OBJ)NCursesInterface.c,) \
-       $(if $(WINDOWS),$(OBJ)Win32Interface.c,) \
-       $(if $(or $(LINUX),$(OSX)),$(OBJ)XInterface.c,) \
+       $(if $(OSX_TARGET),$(OBJ)CocoaDispatch.c,) \
+       $(if $(OSX_TARGET),$(OBJ)CocoaInterface.c,) \
+       $(if $(or $(LINUX_TARGET),$(OSX_TARGET)),$(OBJ)NCursesInterface.c,) \
+       $(if $(WINDOWS_TARGET),$(OBJ)Win32Interface.c,) \
+       $(if $(or $(LINUX_TARGET),$(OSX_TARGET)),$(OBJ)XInterface.c,) \
        $(OBJ)WindowsSkin.c \
        $(OBJ)Anchor.c \
        $(OBJ)ClipBoard.c \
@@ -251,13 +251,13 @@ SYMBOLS1 = \
        $(OBJ)units.sym \
        $(OBJ)i18n.sym \
        $(OBJ)BMPFormat.sym \
-       $(if $(WINDOWS),$(OBJ)GDIDisplayDriver.sym,) \
+       $(if $(WINDOWS_TARGET),$(OBJ)GDIDisplayDriver.sym,) \
        $(OBJ)lfbBlit.sym \
        $(OBJ)lfbConvert.sym \
        $(OBJ)LFBDisplayDriver.sym \
-       $(if $(or $(LINUX),$(OSX)),$(OBJ)NCursesDisplayDriver.sym,) \
-       $(if $(OSX),$(OBJ)CocoaOpenGLDisplayDriver.sym,) \
-       $(if $(LINUX),$(OBJ)XDisplayDriver.sym,) \
+       $(if $(or $(LINUX_TARGET),$(OSX_TARGET)),$(OBJ)NCursesDisplayDriver.sym,) \
+       $(if $(OSX_TARGET),$(OBJ)CocoaOpenGLDisplayDriver.sym,) \
+       $(if $(LINUX_TARGET),$(OBJ)XDisplayDriver.sym,) \
        $(OBJ)Bitmap.sym \
        $(OBJ)BitmapResource.sym \
        $(OBJ)Color.sym \
@@ -290,11 +290,11 @@ SYMBOLS2 = \
        $(OBJ)MessageBox.sym \
        $(OBJ)ReplaceDialog.sym \
        $(OBJ)WindowList.sym \
-       $(if $(OSX),$(OBJ)CocoaDispatch.sym,) \
-       $(if $(OSX),$(OBJ)CocoaInterface.sym,) \
-       $(if $(or $(LINUX),$(OSX)),$(OBJ)NCursesInterface.sym,) \
-       $(if $(WINDOWS),$(OBJ)Win32Interface.sym,) \
-       $(if $(or $(LINUX),$(OSX)),$(OBJ)XInterface.sym,) \
+       $(if $(OSX_TARGET),$(OBJ)CocoaDispatch.sym,) \
+       $(if $(OSX_TARGET),$(OBJ)CocoaInterface.sym,) \
+       $(if $(or $(LINUX_TARGET),$(OSX_TARGET)),$(OBJ)NCursesInterface.sym,) \
+       $(if $(WINDOWS_TARGET),$(OBJ)Win32Interface.sym,) \
+       $(if $(or $(LINUX_TARGET),$(OSX_TARGET)),$(OBJ)XInterface.sym,) \
        $(OBJ)WindowsSkin.sym \
        $(OBJ)Anchor.sym \
        $(OBJ)ClipBoard.sym \
@@ -346,13 +346,13 @@ IMPORTS1 = \
        $(OBJ)units.imp \
        $(OBJ)i18n.imp \
        $(OBJ)BMPFormat.imp \
-       $(if $(WINDOWS),$(OBJ)GDIDisplayDriver.imp,) \
+       $(if $(WINDOWS_TARGET),$(OBJ)GDIDisplayDriver.imp,) \
        $(OBJ)lfbBlit.imp \
        $(OBJ)lfbConvert.imp \
        $(OBJ)LFBDisplayDriver.imp \
-       $(if $(or $(LINUX),$(OSX)),$(OBJ)NCursesDisplayDriver.imp,) \
-       $(if $(OSX),$(OBJ)CocoaOpenGLDisplayDriver.imp,) \
-       $(if $(LINUX),$(OBJ)XDisplayDriver.imp,) \
+       $(if $(or $(LINUX_TARGET),$(OSX_TARGET)),$(OBJ)NCursesDisplayDriver.imp,) \
+       $(if $(OSX_TARGET),$(OBJ)CocoaOpenGLDisplayDriver.imp,) \
+       $(if $(LINUX_TARGET),$(OBJ)XDisplayDriver.imp,) \
        $(OBJ)Bitmap.imp \
        $(OBJ)BitmapResource.imp \
        $(OBJ)Color.imp \
@@ -385,11 +385,11 @@ IMPORTS2 = \
        $(OBJ)MessageBox.imp \
        $(OBJ)ReplaceDialog.imp \
        $(OBJ)WindowList.imp \
-       $(if $(OSX),$(OBJ)CocoaDispatch.imp,) \
-       $(if $(OSX),$(OBJ)CocoaInterface.imp,) \
-       $(if $(or $(LINUX),$(OSX)),$(OBJ)NCursesInterface.imp,) \
-       $(if $(WINDOWS),$(OBJ)Win32Interface.imp,) \
-       $(if $(or $(LINUX),$(OSX)),$(OBJ)XInterface.imp,) \
+       $(if $(OSX_TARGET),$(OBJ)CocoaDispatch.imp,) \
+       $(if $(OSX_TARGET),$(OBJ)CocoaInterface.imp,) \
+       $(if $(or $(LINUX_TARGET),$(OSX_TARGET)),$(OBJ)NCursesInterface.imp,) \
+       $(if $(WINDOWS_TARGET),$(OBJ)Win32Interface.imp,) \
+       $(if $(or $(LINUX_TARGET),$(OSX_TARGET)),$(OBJ)XInterface.imp,) \
        $(OBJ)WindowsSkin.imp \
        $(OBJ)Anchor.imp \
        $(OBJ)ClipBoard.imp \
@@ -444,33 +444,33 @@ SOURCES1 = \
        src/sys/System.c \
        src/sys/i18n.ec \
        src/gfx/bitmaps/BMPFormat.ec \
-       $(if $(WINDOWS),,src/gfx/drivers/harfbuzz/unicode/harfbuzz-freetype.c) \
-       $(if $(WINDOWS),,src/gfx/drivers/harfbuzz/unicode/harfbuzz-unicode-tables.c) \
-       $(if $(WINDOWS),,src/gfx/drivers/harfbuzz/unicode/harfbuzz-unicode.c) \
-       $(if $(WINDOWS),,src/gfx/drivers/harfbuzz/harfbuzz-arabic.c) \
-       $(if $(WINDOWS),,src/gfx/drivers/harfbuzz/harfbuzz-buffer.c) \
-       $(if $(WINDOWS),,src/gfx/drivers/harfbuzz/harfbuzz-gdef.c) \
-       $(if $(WINDOWS),,src/gfx/drivers/harfbuzz/harfbuzz-gpos.c) \
-       $(if $(WINDOWS),,src/gfx/drivers/harfbuzz/harfbuzz-gsub.c) \
-       $(if $(WINDOWS),,src/gfx/drivers/harfbuzz/harfbuzz-hangul.c) \
-       $(if $(WINDOWS),,src/gfx/drivers/harfbuzz/harfbuzz-hebrew.c) \
-       $(if $(WINDOWS),,src/gfx/drivers/harfbuzz/harfbuzz-indic.c) \
-       $(if $(WINDOWS),,src/gfx/drivers/harfbuzz/harfbuzz-khmer.c) \
-       $(if $(WINDOWS),,src/gfx/drivers/harfbuzz/harfbuzz-myanmar.c) \
-       $(if $(WINDOWS),,src/gfx/drivers/harfbuzz/harfbuzz-open.c) \
-       $(if $(WINDOWS),,src/gfx/drivers/harfbuzz/harfbuzz-shaper.c)
+       $(if $(WINDOWS_TARGET),,src/gfx/drivers/harfbuzz/unicode/harfbuzz-freetype.c) \
+       $(if $(WINDOWS_TARGET),,src/gfx/drivers/harfbuzz/unicode/harfbuzz-unicode-tables.c) \
+       $(if $(WINDOWS_TARGET),,src/gfx/drivers/harfbuzz/unicode/harfbuzz-unicode.c) \
+       $(if $(WINDOWS_TARGET),,src/gfx/drivers/harfbuzz/harfbuzz-arabic.c) \
+       $(if $(WINDOWS_TARGET),,src/gfx/drivers/harfbuzz/harfbuzz-buffer.c) \
+       $(if $(WINDOWS_TARGET),,src/gfx/drivers/harfbuzz/harfbuzz-gdef.c) \
+       $(if $(WINDOWS_TARGET),,src/gfx/drivers/harfbuzz/harfbuzz-gpos.c) \
+       $(if $(WINDOWS_TARGET),,src/gfx/drivers/harfbuzz/harfbuzz-gsub.c) \
+       $(if $(WINDOWS_TARGET),,src/gfx/drivers/harfbuzz/harfbuzz-hangul.c) \
+       $(if $(WINDOWS_TARGET),,src/gfx/drivers/harfbuzz/harfbuzz-hebrew.c) \
+       $(if $(WINDOWS_TARGET),,src/gfx/drivers/harfbuzz/harfbuzz-indic.c) \
+       $(if $(WINDOWS_TARGET),,src/gfx/drivers/harfbuzz/harfbuzz-khmer.c) \
+       $(if $(WINDOWS_TARGET),,src/gfx/drivers/harfbuzz/harfbuzz-myanmar.c) \
+       $(if $(WINDOWS_TARGET),,src/gfx/drivers/harfbuzz/harfbuzz-open.c) \
+       $(if $(WINDOWS_TARGET),,src/gfx/drivers/harfbuzz/harfbuzz-shaper.c)
 SOURCES2 = \
-       $(if $(WINDOWS),,src/gfx/drivers/harfbuzz/harfbuzz-stream.c) \
-       $(if $(WINDOWS),,src/gfx/drivers/harfbuzz/harfbuzz-tibetan.c) \
-       $(if $(WINDOWS),,src/gfx/drivers/harfbuzz/harfbuzz-impl.c) \
-       $(if $(WINDOWS),,src/gfx/drivers/harfbuzz/harfbuzz-thai.c) \
-       $(if $(WINDOWS),src/gfx/drivers/GDIDisplayDriver.ec,) \
+       $(if $(WINDOWS_TARGET),,src/gfx/drivers/harfbuzz/harfbuzz-stream.c) \
+       $(if $(WINDOWS_TARGET),,src/gfx/drivers/harfbuzz/harfbuzz-tibetan.c) \
+       $(if $(WINDOWS_TARGET),,src/gfx/drivers/harfbuzz/harfbuzz-impl.c) \
+       $(if $(WINDOWS_TARGET),,src/gfx/drivers/harfbuzz/harfbuzz-thai.c) \
+       $(if $(WINDOWS_TARGET),src/gfx/drivers/GDIDisplayDriver.ec,) \
        src/gfx/drivers/lfbBlit.ec \
        src/gfx/drivers/lfbConvert.ec \
        src/gfx/drivers/LFBDisplayDriver.ec \
-       $(if $(or $(LINUX),$(OSX)),src/gfx/drivers/NCursesDisplayDriver.ec,) \
-       $(if $(OSX),src/gfx/drivers/CocoaOpenGLDisplayDriver.ec,) \
-       $(if $(LINUX),src/gfx/drivers/XDisplayDriver.ec,) \
+       $(if $(or $(LINUX_TARGET),$(OSX_TARGET)),src/gfx/drivers/NCursesDisplayDriver.ec,) \
+       $(if $(OSX_TARGET),src/gfx/drivers/CocoaOpenGLDisplayDriver.ec,) \
+       $(if $(LINUX_TARGET),src/gfx/drivers/XDisplayDriver.ec,) \
        src/gfx/Bitmap.ec \
        src/gfx/BitmapResource.ec \
        src/gfx/Color.ec \
@@ -503,13 +503,13 @@ SOURCES2 = \
        src/gui/dialogs/ReplaceDialog.ec
 SOURCES3 = \
        src/gui/dialogs/WindowList.ec \
-       $(if $(OSX),src/gui/drivers/cocoa/CocoaDispatch.ec,) \
-       $(if $(OSX),src/gui/drivers/cocoa/CocoaEcereBridge.m,) \
-       $(if $(OSX),src/gui/drivers/cocoa/CocoaInterface.ec,) \
-       $(if $(OSX),src/gui/drivers/cocoa/EcereView.m,) \
-       $(if $(or $(LINUX),$(OSX)),src/gui/drivers/NCursesInterface.ec,) \
-       $(if $(WINDOWS),src/gui/drivers/Win32Interface.ec,) \
-       $(if $(or $(LINUX),$(OSX)),src/gui/drivers/XInterface.ec,) \
+       $(if $(OSX_TARGET),src/gui/drivers/cocoa/CocoaDispatch.ec,) \
+       $(if $(OSX_TARGET),src/gui/drivers/cocoa/CocoaEcereBridge.m,) \
+       $(if $(OSX_TARGET),src/gui/drivers/cocoa/CocoaInterface.ec,) \
+       $(if $(OSX_TARGET),src/gui/drivers/cocoa/EcereView.m,) \
+       $(if $(or $(LINUX_TARGET),$(OSX_TARGET)),src/gui/drivers/NCursesInterface.ec,) \
+       $(if $(WINDOWS_TARGET),src/gui/drivers/Win32Interface.ec,) \
+       $(if $(or $(LINUX_TARGET),$(OSX_TARGET)),src/gui/drivers/XInterface.ec,) \
        src/gui/skins/WindowsSkin.ec \
        src/gui/Anchor.ec \
        src/gui/ClipBoard.ec \
@@ -650,6 +650,7 @@ OFLAGS =
 
 # CROSS-PLATFORM MAGIC
 
+include ../crossplatform.mk
 include ../include.mk
 
 # TOOLCHAIN
@@ -674,17 +675,17 @@ LIBS = $(SHAREDLIB) $(EXECUTABLE) $(LINKOPT)
 UPXFLAGS = -9 -q
 
 # HARD CODED PLATFORM-SPECIFIC OPTIONS
-ifdef LINUX
+ifdef LINUX_TARGET
 OFLAGS += -Wl,--no-undefined
 endif
 
-ifdef OSX
+ifdef OSX_TARGET
 OFLAGS += -framework cocoa -framework OpenGL
 endif
 
 # PLATFORM-SPECIFIC OPTIONS
 
-ifdef WINDOWS
+ifdef WINDOWS_TARGET
 
 CFLAGS += \
         -I../deps/DirectX-9.0/include \
@@ -696,14 +697,14 @@ CFLAGS += \
         -I../deps/glext
 
 else
-ifdef LINUX
+ifdef LINUX_TARGET
 
 CFLAGS += \
         -I/usr/include/freetype2 \
         -I../deps/libungif-4.1.1/lib
 
 else
-ifdef OSX
+ifdef OSX_TARGET
 
 CFLAGS += \
         -I/usr/include/freetype2 \
index 142316c..5353116 100644 (file)
@@ -3,6 +3,7 @@
 
 # CROSS-PLATFORM MAGIC
 
+include ../crossplatform.mk
 include ../include.mk
 
 all:
index 1a0ed1e..bcd6af5 100644 (file)
@@ -18,9 +18,10 @@ OFLAGS =
 
 # CROSS-PLATFORM MAGIC
 
+include ../../../crossplatform.mk
 include ../../../include.mk
 
-ifdef LINUX
+ifdef LINUX_TARGET
 TARGET = obj/$(CONFIG).$(PLATFORM)/$(LP)EDASQLite$(SO).0.44
 SONAME = -Wl,-soname,$(LP)EDASQLite$(SO).0
 else
@@ -29,7 +30,7 @@ SONAME =
 endif
 
 OBJECTS = \
-       $(if $(LINUX),,$(OBJ)sqlite3.o) \
+       $(if $(LINUX_TARGET),,$(OBJ)sqlite3.o) \
        $(OBJ)EDASQLite.o \
        $(OBJ)$(MODULE).main$(O)
 
@@ -43,7 +44,7 @@ IMPORTS = \
        $(OBJ)EDASQLite.imp
 
 SOURCES = \
-       $(if $(LINUX),,sqlite3.c) \
+       $(if $(LINUX_TARGET),,sqlite3.c) \
        EDASQLite.ec
 
 RESOURCES = \
@@ -76,7 +77,7 @@ LIBS = $(SHAREDLIB) $(EXECUTABLE) $(LINKOPT)
 UPXFLAGS = -9 -q
 
 # HARD CODED PLATFORM-SPECIFIC OPTIONS
-ifdef LINUX
+ifdef LINUX_TARGET
 OFLAGS += -Wl,--no-undefined
 endif
 
@@ -86,7 +87,7 @@ endif
 
 # PLATFORM-SPECIFIC OPTIONS
 
-ifdef WINDOWS
+ifdef WINDOWS_TARGET
 
 CFLAGS += \
         -I../../../deps/libffi-3.0.11/i686-pc-mingw32/include
@@ -97,7 +98,7 @@ OFLAGS += \
 endif
 
 else
-ifdef LINUX
+ifdef LINUX_TARGET
 
 CFLAGS += \
         -I/usr/include/i686-linux-gnu
@@ -107,7 +108,7 @@ LIBS += -lpthread -ldl -lsqlite3
 endif
 
 else
-ifdef OSX
+ifdef OSX_TARGET
 
 ifneq "$(TARGET_TYPE)" "staticlib"
 LIBS += -lpthread -ldl
@@ -141,7 +142,7 @@ endif
        $(EAR) awq $(TARGET) locale/zh_CN/LC_MESSAGES/EDASQLite.mo "locale/zh_CN/LC_MESSAGES"
        $(EAR) awq $(TARGET) locale/es_ES/LC_MESSAGES/EDASQLite.mo "locale/es_ES/LC_MESSAGES"
        $(call cpq,$(TARGET),../../../$(SODESTDIR))
-ifdef LINUX
+ifdef LINUX_TARGET
        ln -sf $(LP)$(MODULE)$(SO).0.44 ../../../$(SODESTDIR)$(LP)$(MODULE)$(SO).0
        ln -sf $(LP)$(MODULE)$(SO).0.44 ../../../$(SODESTDIR)$(LP)$(MODULE)$(SO)
 endif  
index d16db95..bc8b9e1 100644 (file)
@@ -18,9 +18,10 @@ OFLAGS =
 
 # CROSS-PLATFORM MAGIC
 
+include ../../../crossplatform.mk
 include ../../../include.mk
 
-ifdef LINUX
+ifdef LINUX_TARGET
 TARGET = obj/$(CONFIG).$(PLATFORM)/$(LP)EDASQLiteCipher$(SO).0.44
 SONAME = -Wl,-soname,$(LP)EDASQLiteCipher$(SO).0
 else
@@ -81,7 +82,7 @@ LIBS = $(SHAREDLIB) $(EXECUTABLE) $(LINKOPT)
 UPXFLAGS = -9 -q
 
 # HARD CODED PLATFORM-SPECIFIC OPTIONS
-ifdef LINUX
+ifdef LINUX_TARGET
 OFLAGS += -Wl,--no-undefined
 endif
 
@@ -91,7 +92,7 @@ endif
 
 # PLATFORM-SPECIFIC OPTIONS
 
-ifdef WINDOWS
+ifdef WINDOWS_TARGET
 
 CFLAGS += \
         -I../../../deps/libffi-3.0.11/i686-pc-mingw32/include \
@@ -106,7 +107,7 @@ endif
 LIBS += -llibeay32
 
 else
-ifdef LINUX
+ifdef LINUX_TARGET
 
 CFLAGS += \
         -I/usr/include/i686-linux-gnu
@@ -114,7 +115,7 @@ CFLAGS += \
 LIBS += -lpthread -ldl -lcrypto
 
 else
-ifdef OSX
+ifdef OSX_TARGET
 
 LIBS += -lpthread -ldl -lcrypto
 
@@ -146,7 +147,7 @@ endif
        $(EAR) awq $(TARGET) locale/zh_CN/LC_MESSAGES/EDASQLiteCipher.mo "locale/zh_CN/LC_MESSAGES"
        $(EAR) awq $(TARGET) locale/es_ES/EDASQLiteCipher.mo "locale/es_ES/LC_MESSAGES"
        $(call cpq,$(TARGET),../../../$(SODESTDIR))
-ifdef LINUX
+ifdef LINUX_TARGET
        ln -sf $(LP)$(MODULE)$(SO).0.44 ../../../$(SODESTDIR)$(LP)$(MODULE)$(SO).0
        ln -sf $(LP)$(MODULE)$(SO).0.44 ../../../$(SODESTDIR)$(LP)$(MODULE)$(SO)
 endif  
index 84adf01..f6e6ff5 100644 (file)
@@ -18,9 +18,10 @@ OFLAGS =
 
 # CROSS-PLATFORM MAGIC
 
+include ../../crossplatform.mk
 include ../../include.mk
 
-ifdef LINUX
+ifdef LINUX_TARGET
 TARGET = obj/$(CONFIG).$(PLATFORM)/$(LP)EDA$(SO).0.44
 SONAME = -Wl,-soname,$(LP)EDA$(SO).0
 else
@@ -108,20 +109,20 @@ LIBS = -lecere $(SHAREDLIB) $(EXECUTABLE) $(LINKOPT)
 UPXFLAGS = -9 -q
 
 # HARD CODED PLATFORM-SPECIFIC OPTIONS
-ifdef LINUX
+ifdef LINUX_TARGET
 OFLAGS += -Wl,--no-undefined
 endif
 
 # PLATFORM-SPECIFIC OPTIONS
 
-ifdef WINDOWS
+ifdef WINDOWS_TARGET
 
 CFLAGS += \
         -I../../deps/libffi-3.0.11/i686-pc-mingw32/include
 
 endif
 
-ifdef LINUX
+ifdef LINUX_TARGET
 
 CFLAGS += \
         -I/usr/include/i686-linux-gnu
@@ -152,7 +153,7 @@ endif
        $(EAR) awq $(TARGET) locale/zh_CN/LC_MESSAGES/EDA.mo "locale/zh_CN/LC_MESSAGES"
        $(EAR) awq $(TARGET) locale/es_ES/LC_MESSAGES/EDA.mo "locale/es_ES/LC_MESSAGES"
        $(call cpq,$(TARGET),../../$(SODESTDIR))
-ifdef LINUX
+ifdef LINUX_TARGET
        ln -sf $(LP)$(MODULE)$(SO).0.44 ../../$(SODESTDIR)$(LP)$(MODULE)$(SO).0
        ln -sf $(LP)$(MODULE)$(SO).0.44 ../../$(SODESTDIR)$(LP)$(MODULE)$(SO)
 endif
index 87e23e3..9998b4d 100644 (file)
@@ -63,7 +63,7 @@ SOURCES = \
 
 RESOURCES = \
        locale/zh_CN/LC_MESSAGES/epj2make.mo \
-       ../include.mk
+       ../crossplatform.mk
 
 ifndef DEBIAN_PACKAGE
 CFLAGS =
@@ -72,6 +72,7 @@ OFLAGS =
 
 # CROSS-PLATFORM MAGIC
 
+include ../crossplatform.mk
 include ../include.mk
 
 # TOOLCHAIN
@@ -100,13 +101,13 @@ LIBS = -lecere $(SHAREDLIB) $(EXECUTABLE) $(LINKOPT)
 UPXFLAGS = -9 -q
 
 # HARD CODED PLATFORM-SPECIFIC OPTIONS
-ifdef LINUX
+ifdef LINUX_TARGET
 OFLAGS += -Wl,--no-undefined
 endif
 
 # PLATFORM-SPECIFIC OPTIONS
 
-ifdef LINUX
+ifdef LINUX_TARGET
 
 endif
 
index 2d1b0c2..81ddb83 100644 (file)
@@ -355,8 +355,8 @@ class epj2makeApp : GuiApplication
                   }
                   if(valid)
                   {
-                     project.GenerateCompilerMk(defaultCompiler);
-                     project.GenerateCrossPlatformCf();
+                     project.GenerateCompilerCf(defaultCompiler);
+                     project.GenerateCrossPlatformMk();
                      if(project.GenerateMakefile(makePath, noResources, includemkPath, project.config))
                      {
                         if(makePath)
index 2c2bf85..83dd0ff 100644 (file)
@@ -33,7 +33,7 @@ OBJECTS = \
        $(OBJ)ProjectNode.o \
        $(OBJ)ProjectView.o \
        $(OBJ)Workspace.o \
-       $(if $(WINDOWS),$(OBJ)vsSupport.o,) \
+       $(if $(WINDOWS_TARGET),$(OBJ)vsSupport.o,) \
        $(OBJ)CodeEditor.o \
        $(OBJ)CodeObject.o \
        $(OBJ)Designer.o \
@@ -80,7 +80,7 @@ COBJECTS = \
        $(OBJ)ProjectNode.c \
        $(OBJ)ProjectView.c \
        $(OBJ)Workspace.c \
-       $(if $(WINDOWS),$(OBJ)vsSupport.c,) \
+       $(if $(WINDOWS_TARGET),$(OBJ)vsSupport.c,) \
        $(OBJ)CodeEditor.c \
        $(OBJ)CodeObject.c \
        $(OBJ)Designer.c \
@@ -127,7 +127,7 @@ SYMBOLS1 = \
        $(OBJ)ProjectNode.sym \
        $(OBJ)ProjectView.sym \
        $(OBJ)Workspace.sym \
-       $(if $(WINDOWS),$(OBJ)vsSupport.sym,) \
+       $(if $(WINDOWS_TARGET),$(OBJ)vsSupport.sym,) \
        $(OBJ)CodeEditor.sym \
        $(OBJ)CodeObject.sym \
        $(OBJ)Designer.sym \
@@ -175,7 +175,7 @@ IMPORTS1 = \
        $(OBJ)ProjectNode.imp \
        $(OBJ)ProjectView.imp \
        $(OBJ)Workspace.imp \
-       $(if $(WINDOWS),$(OBJ)vsSupport.imp,) \
+       $(if $(WINDOWS_TARGET),$(OBJ)vsSupport.imp,) \
        $(OBJ)CodeEditor.imp \
        $(OBJ)CodeObject.imp \
        $(OBJ)Designer.imp \
@@ -222,7 +222,7 @@ SOURCES = \
        src/project/ProjectNode.ec \
        src/project/ProjectView.ec \
        src/project/Workspace.ec \
-       $(if $(WINDOWS),src/project/vsSupport.ec,) \
+       $(if $(WINDOWS_TARGET),src/project/vsSupport.ec,) \
        src/designer/CodeEditor.ec \
        src/designer/CodeObject.ec \
        src/designer/Designer.ec \
@@ -307,7 +307,6 @@ RESOURCES2 = \
        res/ecere.jpg \
        res/ecereBack.jpg \
        res/icon.png \
-       ../include.mk \
        ../crossplatform.mk
 
 ifndef DEBIAN_PACKAGE
@@ -317,6 +316,7 @@ OFLAGS =
 
 # CROSS-PLATFORM MAGIC
 
+include ../crossplatform.mk
 include ../include.mk
 
 # TOOLCHAIN
@@ -344,18 +344,18 @@ LIBS = -lecere $(SHAREDLIB) $(EXECUTABLE) $(LINKOPT)
 UPXFLAGS = -9 -q
 
 # HARD CODED PLATFORM-SPECIFIC OPTIONS
-ifdef LINUX
+ifdef LINUX_TARGET
 OFLAGS += -Wl,--no-undefined
 endif
 
 # PLATFORM-SPECIFIC OPTIONS
 
-ifdef WINDOWS
+ifdef WINDOWS_TARGET
 
 LIBS += obj/resources.o
 
 else
-ifdef LINUX
+ifdef LINUX_TARGET
 
 OFLAGS += \
         -L/usr/X11R6/lib
@@ -363,7 +363,7 @@ OFLAGS += \
 LIBS += -lX11
 
 else
-ifdef OSX
+ifdef OSX_TARGET
 
 OFLAGS += \
         -L/usr/X11R6/lib
@@ -391,14 +391,14 @@ $(OBJ)$(MODULE).main.c: $(OBJ)$(MODULE).main.ec
 $(SYMBOLS): | objdir
 $(OBJECTS): | objdir
 $(TARGET): $(SOURCES) $(RESOURCES) $(SYMBOLS) $(OBJECTS) | objdir
-ifdef WINDOWS
+ifdef WINDOWS_TARGET
 $(TARGET): obj/resources.o
 endif
        $(CC) $(OFLAGS) $(OBJECTS) $(LIBS) -o $(TARGET) $(INSTALLNAME)
 ifndef NOSTRIP
        $(STRIP) $(STRIPOPT) $(TARGET)
 endif
-       $(EAR) awq $(TARGET) res/ecere.jpg res/ecereBack.jpg res/icon.png ../include.mk ../crossplatform.mk ""
+       $(EAR) awq $(TARGET) res/ecere.jpg res/ecereBack.jpg res/icon.png ../crossplatform.mk ""
        $(EAR) awq $(TARGET) $(RES)actions/attach.png $(RES)actions/delete.png $(RES)actions/detach.png $(RES)actions/docNew.png $(RES)actions/editCopy.png $(RES)actions/editDelete.png $(RES)actions/delete2.png $(RES)actions/build.png $(RES)actions/clean.png $(RES)actions/debug.png "actions"
        $(EAR) awq $(TARGET) $(RES)actions/docOpen.png $(RES)actions/docSave.png $(RES)actions/docSaveAll.png $(RES)actions/pause.png $(RES)actions/projAdd.png $(RES)actions/projNew.png $(RES)actions/projOpen.png $(RES)actions/rebuild.png $(RES)actions/regMakefile.png $(RES)actions/relink.png "actions"
        $(EAR) awq $(TARGET) $(RES)actions/restart.png $(RES)actions/run.png $(RES)actions/skipBreaks.png $(RES)actions/stepInto.png $(RES)actions/stepOut.png $(RES)actions/stepOver.png $(RES)actions/stopDebug.png "actions"
@@ -410,7 +410,7 @@ endif
        $(EAR) awq $(TARGET) ../extras/res/licenses/gpl.LICENSE "licenses"
        $(call cpq,$(TARGET),../obj/$(PLATFORM)/bin/)
 
-ifdef WINDOWS
+ifdef WINDOWS_TARGET
 obj/resources.o: src/icon2.ico src/resources.rc | objdir
        windres src/resources.rc obj/resources.o
 endif
index 46534bf..3d1f3ab 100644 (file)
@@ -69,8 +69,8 @@ PathRelationship eString_PathRelated(char * path, char * to, char * pathDiff)
 
 char * CopyValidateMakefilePath(char * path)
 {
-   const int map[]  =    { 0,           1,           2,             3,             4,           5,                    6,                 0,             1,                 7         };
-   const char * vars[] = { "$(MODULE)", "$(CONFIG)", "$(PLATFORM)", "$(COMPILER)", "$(TARGET)", "$(COMPILER_SUFFIX)", "$(DEBUG_SUFFIX)", "$(PROJECT)",  "$(CONFIGURATION)",(char *)0 };
+   const int map[]  =    {           0,           1,             2,             3,           4,                    5,                 6,            0,                   1,                    2,        7 };
+   const char * vars[] = { "$(MODULE)", "$(CONFIG)", "$(PLATFORM)", "$(COMPILER)", "$(TARGET)", "$(COMPILER_SUFFIX)", "$(DEBUG_SUFFIX)", "$(PROJECT)",  "$(CONFIGURATION)", "$(TARGET_PLATFORM)",(char *)0 };
 
    char * copy = null;
    if(path)
index 6a3f513..0244db1 100644 (file)
@@ -666,7 +666,7 @@ char * PlatformToMakefileVariable(Platform platform)
 {
    return platform == win32 ? "WINDOWS" :
           platform == tux   ? "LINUX"   :
-          platform == apple ? "OSX"/*"APPLE"*/ :
+          platform == apple ? "OSX"     :
                               platform;
 }
 
@@ -684,6 +684,14 @@ char * GetConfigName(ProjectConfig config)
    return config ? config.name : "Common";
 }
 
+char * PlatformToMakefileTargetVariable(Platform platform)
+{
+   return platform == win32 ? "WINDOWS_TARGET" :
+          platform == tux   ? "LINUX_TARGET"   :
+          platform == apple ? "OSX_TARGET"     :
+                              "ERROR_BAD_TARGET";
+}
+
 class Project : struct
 {
    class_no_expansion;  // To use Find on the Container<Project> in Workspace::projects
@@ -1674,7 +1682,7 @@ private:
       strcpy(makeFilePath, topNode.path);
       CatMakeFileName(makeFile, config);
       PathCatSlash(makeFilePath, makeFile);
-      
+
       // TODO: TEST ON UNIX IF \" around makeTarget is ok
       if(onlyNode)
       {
@@ -1692,8 +1700,18 @@ private:
             ChangeWorkingDir(topNode.path);
             // Create object dir if it does not exist already
             if(!FileExists(objDirExp.dir).isDirectory)
-               Execute("%s CF_DIR=%s%s%s COMPILER=%s objdir -C \"%s\" -f \"%s\"", compiler.makeCommand, cfDir,
-                  crossCompiling ? " PLATFORM=" : "", targetPlatform, compilerName, topNode.path, makeFilePath);
+            {
+               sprintf(command, "%s CF_DIR=\"%s\"%s%s COMPILER=%s objdir -C \"%s\" -f \"%s\"",
+                     compiler.makeCommand, cfDir,
+                     crossCompiling ? " TARGET_PLATFORM=" : "", targetPlatform,
+                     compilerName, topNode.path, makeFilePath);
+#ifdef _DEBUG
+               PrintLn(command);
+               ide.outputView.buildBox.Logf("command: %s\n", command);
+#endif
+               Execute(command);
+            }
+
             ChangeWorkingDir(pushD);
 
             PathCatSlash(makeTarget+1, objDirExp.dir);
@@ -1716,6 +1734,10 @@ private:
 
          sprintf(command, "%s /useenv /nologo /logcommands %s.sln %s|Win32", compiler.makeCommand, name, config.name);
          ide.outputView.buildBox.Logf("command: %s\n", command);
+#ifdef _DEBUG
+         PrintLn(command);
+         ide.outputView.buildBox.Logf("command: %s\n", command);
+#endif
          if((f = DualPipeOpen(PipeOpenMode { output = true, error = true, input = true }, command)))
          {
             ProcessPipeOutputRaw(f);
@@ -1728,19 +1750,29 @@ private:
       {
          char cfDir[MAX_LOCATION];
          GetIDECompilerConfigsDir(cfDir, true, true);
-         sprintf(command, "%s CF_DIR=\"%s\"%s%s COMPILER=%s -j%d %s%s%s -C \"%s\" -f \"%s\"", compiler.makeCommand, cfDir,
-               crossCompiling ? " PLATFORM=" : "", targetPlatform,
+         sprintf(command, "%s CF_DIR=\"%s\"%s%s COMPILER=%s -j%d %s%s%s -C \"%s\" -f \"%s\"",
+               compiler.makeCommand, cfDir,
+               crossCompiling ? " TARGET_PLATFORM=" : "", targetPlatform,
                compilerName, numJobs,
                compiler.ccacheEnabled ? "CCACHE=y " : "",
                compiler.distccEnabled ? "DISTCC=y " : "",
                makeTarget, topNode.path, makeFilePath);
+#ifdef _DEBUG
+         PrintLn(command);
+         ide.outputView.buildBox.Logf("command: %s\n", command);
+#endif
          if((f = DualPipeOpen(PipeOpenMode { output = true, error = true, input = true }, command)))
          {
             result = ProcessBuildPipeOutput(f, objDirExp, isARun, onlyNode, compiler, config);
             delete f;
          }
          else
+         {
             ide.outputView.buildBox.Logf($"Error executing make (%s) command\n", compiler.makeCommand);
+#ifndef _DEBUG
+            ide.outputView.buildBox.Logf("command: %s\n", command);
+#endif
+         }
       }
 
       delete pathBackup;
@@ -1778,6 +1810,10 @@ private:
          
          sprintf(command, "%s /useenv /clean /nologo /logcommands %s.sln %s|Win32", compiler.makeCommand, name, config.name);
          ide.outputView.buildBox.Logf("command: %s\n", command);
+#ifdef _DEBUG
+         PrintLn(command);
+         ide.outputView.buildBox.Logf("command: %s\n", command);
+#endif
          if((f = DualPipeOpen(PipeOpenMode { output = true, error = true, input = true }, command)))
          {
             ProcessPipeOutputRaw(f);
@@ -1791,8 +1827,14 @@ private:
       {
          char cfDir[MAX_LOCATION];
          GetIDECompilerConfigsDir(cfDir, true, true);
-         sprintf(command, "%s CF_DIR=%s%s%s COMPILER=%s %sclean -C \"%s\" -f \"%s\"", compiler.makeCommand, cfDir,
-            crossCompiling ? " PLATFORM=" : "", targetPlatform, compilerName, realclean ? "real" : "", topNode.path, makeFilePath);
+         sprintf(command, "%s CF_DIR=\"%s\"%s%s COMPILER=%s %sclean -C \"%s\" -f \"%s\"",
+               compiler.makeCommand, cfDir,
+               crossCompiling ? " TARGET_PLATFORM=" : "", targetPlatform,
+               compilerName, realclean ? "real" : "", topNode.path, makeFilePath);
+#ifdef _DEBUG
+         PrintLn(command);
+         ide.outputView.buildBox.Logf("command: %s\n", command);
+#endif
          if((f = DualPipeOpen(PipeOpenMode { output = 1, error = 1, input = 2 }, command)))
          {
             ide.outputView.buildBox.Tell($"Deleting target and object files...");
@@ -1885,7 +1927,7 @@ private:
       }
    }
 
-   bool GenerateCrossPlatformCf()
+   bool GenerateCrossPlatformMk()
    {
       bool result = false;
       char path[MAX_LOCATION];
@@ -1930,7 +1972,7 @@ private:
       return result;
    }
 
-   bool GenerateCompilerMk(CompilerConfig compiler)
+   bool GenerateCompilerCf(CompilerConfig compiler)
    {
       bool result = false;
       char path[MAX_LOCATION];
@@ -1964,11 +2006,6 @@ private:
          File f = FileOpen(path, write);
          if(f)
          {
-            /*
-            if(compiler.targetPlatform != GetRuntimePlatform())
-               f.Printf("\nPLATFORM = %s\n", (char *)compiler.targetPlatform);
-            */
-
             f.Printf("# TOOLCHAIN\n\n");
 
             //f.Printf("SHELL := %s\n", "sh"/*compiler.shellCommand*/); // is this really needed?
@@ -1977,7 +2014,7 @@ private:
             f.Printf("CXX := $(CCACHE_COMPILE) $(DISTCC_COMPILE) %s\n", compiler.cxxCommand);
             f.Printf("ECP := %s\n", compiler.ecpCommand);
             f.Printf("ECC := %s\n", compiler.eccCommand);
-            f.Printf("ECS := %s -t $(PLATFORM)\n", compiler.ecsCommand);
+            f.Printf("ECS := %s -t $(TARGET_PLATFORM)\n", compiler.ecsCommand);
             f.Printf("EAR := %s\n", compiler.earCommand);
 
             f.Printf("AS := as\n");
@@ -1998,13 +2035,13 @@ private:
 
             f.Printf("UPXFLAGS = -9\n\n"); // TOFEAT: Compression Level Option? Other UPX Options?
 
-            f.Printf("# HARD CODED PLATFORM-SPECIFIC OPTIONS\n");
-            f.Printf("ifeq \"$(PLATFORM)\" \"linux\"\n"); //, PlatformToMakefileVariable(tux));
+            f.Printf("# HARD CODED TARGET_PLATFORM-SPECIFIC OPTIONS\n");
+            f.Printf("ifdef %s\n", PlatformToMakefileTargetVariable(tux));
             f.Printf("LDFLAGS += -Wl,--no-undefined\n");
             f.Printf("endif\n\n");
 
             // JF's
-            f.Printf("ifeq \"$(PLATFORM)\" \"apple\"\n"); //%s\n", PlatformToMakefileVariable(apple));
+            f.Printf("ifdef %s\n", PlatformToMakefileTargetVariable(apple));
             f.Printf("LDFLAGS += -framework cocoa -framework OpenGL\n");
             f.Printf("endif\n");
 
@@ -2188,7 +2225,7 @@ private:
                   if(ifCount)
                      f.Printf("else\n");
                   ifCount++;
-                  f.Printf("ifeq \"$(PLATFORM)\" \"%s\"\n", (char *)platform); //%s\n", PlatformToMakefileVariable(platform));
+                  f.Printf("ifdef %s\n", PlatformToMakefileTargetVariable(platform));
 
                   f.Printf("TARGET_TYPE = ");
                   f.Printf(TargetTypeToMakefileVariable(targetType));
@@ -2227,7 +2264,7 @@ private:
          f.Printf("# INCLUDES\n\n");
 
          f.Printf("include %s\n", includemkPath ? includemkPath : "$(_CF_DIR)crossplatform.mk");
-         f.Printf("include $(_CF_DIR)$(PLATFORM)-$(COMPILER).cf\n");
+         f.Printf("include $(_CF_DIR)$(TARGET_PLATFORM)-$(COMPILER).cf\n");
          f.Printf("\n");
 
          f.Printf("# VARIABLES\n\n");
@@ -2355,7 +2392,7 @@ private:
             //for(platform = firstPlatform; platform <= lastPlatform; platform++)
             //for(platform = win32; platform <= apple; platform++)
 
-            f.Printf("# PLATFORM-SPECIFIC OPTIONS\n\n");
+            f.Printf("# TARGET_PLATFORM-SPECIFIC OPTIONS\n\n");
             for(platform = (Platform)1; platform < Platform::enumSize; platform++)
             {
                PlatformOptions projectPlatformOptions, configPlatformOptions;
@@ -2366,10 +2403,8 @@ private:
                   if(ifCount)
                      f.Printf("else\n");
                   ifCount++;
-                  f.Printf("ifeq \"$(PLATFORM)\" \"");
-                  // f.Printf(PlatformToMakefileVariable(platform));
-                  f.Printf((char *)platform);
-                  f.Printf("\"\n\n");
+                  f.Printf("ifdef %s\n", PlatformToMakefileTargetVariable(platform));
+                  f.Printf("\n");
 
                   if((projectPlatformOptions && projectPlatformOptions.options.preprocessorDefinitions && projectPlatformOptions.options.preprocessorDefinitions.count) ||
                      (configPlatformOptions && configPlatformOptions.options.preprocessorDefinitions && configPlatformOptions.options.preprocessorDefinitions.count) ||
@@ -2480,7 +2515,7 @@ private:
             OutputListOption(f, "I", options.includeDirs, lineEach, true);
          f.Printf("\n\n");
 
-         f.Printf("CECFLAGS += -cpp $(call escspace,$(CPP)) -t $(PLATFORM)");
+         f.Printf("CECFLAGS += -cpp $(call escspace,$(CPP)) -t $(TARGET_PLATFORM)");
          f.Printf("\n\n");
 
          f.Printf("ECFLAGS +=");
@@ -2532,7 +2567,7 @@ private:
          if(platforms || (config && config.platforms))
          {
             ifCount = 0;
-            //f.Printf("# PLATFORM-SPECIFIC PRE-BUILD COMMANDS\n");
+            //f.Printf("# TARGET_PLATFORM-SPECIFIC PRE-BUILD COMMANDS\n");
             for(platform = (Platform)1; platform < Platform::enumSize; platform++)
             {
                PlatformOptions projectPOs, configPOs;
@@ -2641,7 +2676,7 @@ private:
          if(platforms || (config && config.platforms))
          {
             ifCount = 0;
-            //f.Printf("# PLATFORM-SPECIFIC POST-BUILD COMMANDS\n");
+            //f.Printf("# TARGET_PLATFORM-SPECIFIC POST-BUILD COMMANDS\n");
             for(platform = (Platform)1; platform < Platform::enumSize; platform++)
             {
                PlatformOptions projectPOs, configPOs;
index 3bad78b..aa0b446 100644 (file)
@@ -825,7 +825,7 @@ private:
                {
                   char * comma = mn.next ? "," : "";
 
-                  var = PlatformToMakefileVariable(mn.key);
+                  var = PlatformToMakefileTargetVariable(mn.key);
 
                   exp = result.a;
                   len = strlen(exp) + strlen("$(") + strlen(var) + strlen(")") + strlen(comma);
@@ -845,9 +845,9 @@ private:
          else
          {
             if(exclusionInfo.root.minimum.key != unknown)
-               var = PlatformToMakefileVariable(exclusionInfo.root.minimum.key);
+               var = PlatformToMakefileTargetVariable(exclusionInfo.root.minimum.key);
             else
-               var = PlatformToMakefileVariable(exclusionInfo.root.minimum.next.key);
+               var = PlatformToMakefileTargetVariable(exclusionInfo.root.minimum.next.key);
 
             exp = result.a;
             len = strlen(exp) + strlen("$(if $(") + strlen(var) + strlen("),");
@@ -2233,7 +2233,7 @@ static inline void OpenRulesPlatformExclusionIfs(File f, int * ifCount, Platform
       if(*ifCount)                 // we really need a if defined(a) || defined(b) here
          f.Printf("else\n");       // instead of repeating the rules for each platform
       (*ifCount)++;                  //
-      f.Printf("ifdef %s\n\n", PlatformToMakefileVariable(platform)); //
+      f.Printf("ifdef %s\n\n", PlatformToMakefileTargetVariable(platform)); //
       if(excludedPlatforms)
          excludedPlatforms[platform] = true;
    }
index 10e7586..8be62dc 100644 (file)
@@ -586,8 +586,8 @@ class ProjectView : Window
 
    bool ProjectPrepareCompiler(Project project, CompilerConfig compiler)
    {
-      project.GenerateCrossPlatformCf();
-      project.GenerateCompilerMk(compiler);
+      project.GenerateCrossPlatformMk();
+      project.GenerateCompilerCf(compiler);
       return true;
    }
 
index 2a248fc..ef7565b 100644 (file)
@@ -1,94 +1,3 @@
-# HOST PLATFORM DETECTION
-ifeq "$(OS)" "Windows_NT"
-   WINDOWS = defined
-else
-ifeq "$(OSTYPE)" "FreeBSD"
-   BSD = defined
-else
-ifeq "$(shell uname)" "Darwin"
-   OSX = defined
-else
-   LINUX = defined
-endif
-endif
-endif
-
-# PLATFORM (TARGET)
-ifndef PLATFORM
-ifdef WINDOWS
-   PLATFORM := win32
-else
-ifdef OSX
-   PLATFORM := apple
-else
-   PLATFORM := linux
-endif
-endif
-endif
-
-# MISC STRING TOOLS
-empty :=
-space := $(empty) $(empty)
-escspace = $(subst $(space),\$(space),$(subst \$(space),$(space),$1))
-hidspace = $(subst $(space),\7f,$(subst \$(space),\7f,$1))
-shwspace = $(subst \7f,\$(space),$1)
-
-# PATH SEPARATOR STRING TOOLS
-ifdef WINDOWS
-ifndef MSYSCON
-   WIN_PS_TOOLS := defined
-endif
-endif
-ifdef WIN_PS_TOOLS
-   fixps = $(subst \,/,$(1))
-   psep = $(subst \\,/,$(subst /,\,$(1)))
-   PS := $(strip \)
-else
-   fixps = $(1)
-   PS := $(strip /)
-   psep = $(1)
-endif
-
-# PREFIXES AND EXTENSIONS
-.SUFFIXES: .c .ec .sym .imp .bowl .o .a
-S := .sym
-I := .imp
-B := .bowl
-C := .c
-O := .o
-A := .a
-ifeq "$(PLATFORM)" "win32"
-   E := .exe
-ifeq "$(TARGET_TYPE)" "staticlib"
-   LP := lib
-else
-   LP :=
-endif
-   SO := .dll
-else
-ifeq "$(PLATFORM)" "apple"
-   E :=
-   LP := lib
-   SO := .dylib
-else
-   E :=
-   LP := lib
-   SO := .so
-endif
-endif
-
-# SUPER TOOLS
-ifdef CCACHE
-   CCACHE_COMPILE := ccache
-ifdef DISTCC
-   DISTCC_COMPILE := distcc
-endif
-else
-ifdef DISTCC
-   DISTCC_COMPILE := distcc
-endif
-endif
-
 # TOOLCHAIN
 export CC      = $(CCACHE_COMPILE) $(DISTCC_COMPILE) gcc
 export CPP     = $(CCACHE_COMPILE) $(DISTCC_COMPILE) cpp
@@ -102,105 +11,8 @@ export AR      = ar
 export STRIP   = strip
 UPX := upx
 
-# SHELL COMMANDS
-ifdef WINDOWS
-ifndef MSYSCON
-   WIN_SHELL_COMMANDS := defined
-endif
-endif
-ifdef WIN_SHELL_COMMANDS
-   echo = $(if $(1),echo $(1))
-   cpq = $(if $(1),@cmd /c for %%I in ($(call psep,$(1))) do @copy /y %%I $(call psep,$(2)) > nul 2>&1)
-   rmq = $(if $(1),-@del /f /q $(call psep,$(1)) > nul 2>&1)
-   rmrq = $(if $(1),-@rmdir /q /s $(call psep,$(1)) > nul 2>&1)
-   mkdirq = $(if $(1),-@mkdir $(call psep,$(1)) > nul 2>&1)
-   rmdirq = $(if $(1),-@rmdir /q $(call psep,$(1)) > nul 2>&1)
-else
-   echo = $(if $(1),echo "$(1)")
-   cpq = $(if $(1),@cp $(1) $(2))
-   rmq = $(if $(1),-@rm -f $(1))
-   rmrq = $(if $(1),-@rm -f -r $(1))
-   mkdirq = $(if $(1),-@mkdir -p $(1))
-   rmdirq = $(if $(1),-@rmdir $(1))
-endif
-
-# COMPILER OPTIONS
-ifeq "$(TARGET_TYPE)" "sharedlib"
-   ECSLIBOPT := -dynamiclib
-else
-ifeq "$(TARGET_TYPE)" "staticlib"
-   ECSLIBOPT := -staticlib
-else
-   ECSLIBOPT :=
-endif
-endif
-ifdef WINDOWS
-   FVISIBILITY :=
-   FPIC :=
-ifeq "$(TARGET_TYPE)" "executable"
-   EXECUTABLE := $(CONSOLE)
-else
-   EXECUTABLE :=
-endif
-else
-   FVISIBILITY := -fvisibility=hidden
-   FPIC := -fPIC
-   EXECUTABLE :=
-endif
-ifdef OSX
-ifeq "$(TARGET_TYPE)" "sharedlib"
-   INSTALLNAME := -install_name $(LP)$(MODULE)$(SO)
-else
-   INSTALLNAME :=
-endif
-else
-   INSTALLNAME :=
-endif
-
 # DEBIAN
 ifdef DEBIAN_PACKAGE
 CFLAGS += $(CPPFLAGS)
 OFLAGS += $(LDFLAGS)
 endif
-
-# LINKER OPTIONS
-ifdef OSX
-ifeq "$(TARGET_TYPE)" "sharedlib"
-   SHAREDLIB := -dynamiclib -single_module -multiply_defined suppress
-   LINKOPT :=
-else
-   SHAREDLIB :=
-   LINKOPT :=
-endif
-ifeq "$(TARGET_TYPE)" "sharedlib"
-   STRIPOPT := -x
-else
-   STRIPOPT := -u -r
-endif
-else
-ifeq "$(TARGET_TYPE)" "sharedlib"
-   SHAREDLIB := -shared
-else
-   SHAREDLIB :=
-endif
-   LINKOPT :=
-   STRIPOPT := -x --strip-unneeded --remove-section=.comment --remove-section=.note
-endif
-ifdef WINDOWS
-   SODESTDIR := obj/$(PLATFORM)/bin/
-else
-   SODESTDIR := obj/$(PLATFORM)/lib/
-endif
-
-# COMMON LIBRARIES DETECTION
-
-ifdef WINDOWS
-
-ifdef OPENSSL_CONF
-_OPENSSL_CONF = $(call hidspace,$(call fixps,$(OPENSSL_CONF)))
-OPENSSL_INCLUDE_DIR = $(call shwspace,$(subst /bin/openssl.cfg,/include,$(_OPENSSL_CONF)))
-OPENSSL_LIB_DIR = $(call shwspace,$(subst /bin/openssl.cfg,/lib,$(_OPENSSL_CONF)))
-OPENSSL_BIN_DIR = $(call shwspace,$(subst /bin/openssl.cfg,/bin,$(_OPENSSL_CONF)))
-endif
-
-endif