compiler/libec: Recognizing uint suffixes for expression types
[sdk] / Makefile
index 38e6fc3..f36bb17 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,21 +1,23 @@
-.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 fixprecompile
+.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 fixprecompile cleantarget pots installer
 ifneq "$V" "1"
 .SILENT:
 endif
 
-LIBVER := .0.44
-
 include crossplatform.mk
 include default.cf
 
 ifdef BSD_HOST
+INSTALL_FLAGS :=
 CPFLAGS := -pRf
 else
+INSTALL_FLAGS := -D
 CPFLAGS := -dpRf
 endif
 
 XBOOT := $(if $(CROSS_TARGET),GCC_PREFIX= TARGET_PLATFORM=$(HOST_PLATFORM) PLATFORM=$(HOST_PLATFORM),)
 
+LIBVER := .0.44
+
 ifdef WINDOWS_HOST
 HOST_SOV := $(HOST_SO)
 else
@@ -24,10 +26,50 @@ endif
 
 ifdef WINDOWS_TARGET
 
+SOV := $(SO)
+
+ifndef DESTDIR
+
+ifeq "$(TARGET_ARCH)" "x86_64"
+   ifneq "$(wildcard $(SystemDrive)/Program\ Files )" ""
+      export DESTDIR=$(SystemDrive)/Program Files/Ecere SDK
+   else
+      export DESTDIR=$(SystemDrive)/Ecere SDK
+   endif
+else
+   ifdef ProgramFiles(x86)
+      export DESTDIR=${ProgramFiles(x86)}/Ecere SDK
+   else
+      ifdef ProgramFiles
+         export DESTDIR=$(ProgramFiles)/Ecere SDK
+      else
+         export DESTDIR=$(SystemDrive)/Ecere SDK
+      endif
+   endif
+endif
+
+endif # DESTDIR
+
+export prefix=
+
 ifndef DOCDIR
 export DOCDIR=$(DESTDIR)$(prefix)/doc
 endif
 
+ifndef BINDIR
+export BINDIR=$(DESTDIR)$(prefix)/bin
+endif
+
+ifndef LIBDIR
+export LIBDIR=$(BINDIR)
+endif
+export DESTLIBDIR=$(LIBDIR)
+
+ifndef SLIBDIR
+export SLIBDIR=$(DESTDIR)$(prefix)/lib
+endif
+export DESTSLIBDIR=$(SLIBDIR)
+
 ifndef SAMPLESDIR
 export SAMPLESDIR=$(DESTDIR)$(prefix)/samples
 endif
@@ -36,8 +78,24 @@ ifndef EXTRASDIR
 export EXTRASDIR=$(DESTDIR)$(prefix)/extras
 endif
 
+
 else # WINDOWS_TARGET
 
+ifdef OSX_TARGET
+# TODO: OSX soname
+SOV := $(SO)
+else
+SOV := $(SO)$(LIBVER)
+endif
+
+ifndef DESTDIR
+export DESTDIR=
+endif
+
+ifndef prefix
+export prefix=/usr
+endif
+
 ifndef DOCDIR
 export DOCDIR=$(DESTDIR)$(prefix)/share/ecere/doc
 endif
@@ -46,9 +104,37 @@ ifndef MANDIR
 export MANDIR=$(DESTDIR)$(prefix)/share/man/
 endif
 
+ifndef BINDIR
+export BINDIR=$(DESTDIR)$(prefix)/bin
+endif
+
+ifdef LIBDIR
+ export PREFIXLIBDIR=$(LIBDIR)
+else
+ export PREFIXLIBDIR=$(prefix)/lib/$(TARGET_ARCH)
+
+ ifeq "$(wildcard $(prefix)/lib/$(TARGET_ARCH) )" ""
+  export PREFIXLIBDIR=$(prefix)/lib
+
+  ifeq "$(TARGET_ARCH)" "i386-linux-gnu"
+   ifneq "$(wildcard $(prefix)/lib32 )" ""
+    export PREFIXLIBDIR=$(prefix)/lib32
+   endif
+  endif
+
+ endif
+endif
+
 export CPPFLAGS
 CPPFLAGS += -DDEB_HOST_MULTIARCH=\"$(call escspace,$(PREFIXLIBDIR))\"
 
+DESTLIBDIR := $(DESTDIR)$(PREFIXLIBDIR)
+ifdef SLIBDIR
+DESTSLIBDIR := $(DESTDIR)$(SLIBDIR)
+else
+DESTSLIBDIR := $(DESTLIBDIR)
+endif
+
 ifndef SAMPLESDIR
 export SAMPLESDIR=$(DESTDIR)$(prefix)/share/ecere/samples
 endif
@@ -57,8 +143,8 @@ ifndef EXTRASDIR
 export EXTRASDIR=$(DESTDIR)$(prefix)/share/ecere/extras
 endif
 
-endif # WINDOWS_TARGET
 
+endif
 
 OBJDIR := obj$(OBJALT)/
 OBJBINDIR := $(OBJDIR)$(PLATFORM)$(COMPILER_SUFFIX)$(DEBUG_SUFFIX)/bin/
@@ -237,6 +323,10 @@ endif
 endif
 
 eda: prepbinaries
+ifdef CROSS_TARGET
+       @$(call echo,Building EDA (host))
+       cd eda && $(MAKE) $(XBOOT)
+endif
        @$(call echo,Building EDA...)
        cd eda && $(MAKE)
 
@@ -279,6 +369,31 @@ ifdef EDASQLiteCipher
        $(call rmq,$(OBJBINDIR)CodeGuard$(E))
 endif
 
+cleantarget:
+       cd compiler && $(MAKE) cleantarget
+       cd documentor && $(MAKE) cleantarget
+       cd ear && $(MAKE) cleantarget
+       cd ecere && $(MAKE) cleantarget
+       cd eda && $(MAKE) cleantarget
+       cd epj2make && $(MAKE) cleantarget
+       cd ide && $(MAKE) cleantarget
+       cd installer && $(MAKE) cleantarget
+
+pots: cleantarget
+       $(MAKE) OUTPUT_POT=1
+       cd installer && $(MAKE) OUTPUT_POT=1 pots
+
+ifdef WINDOWS_TARGET
+installer:
+       $(MAKE) prepinstall ARCH=
+       $(MAKE) prepinstall ARCH=x32
+       @$(call echo,Building Ecere runtime for installer...)
+       cd ecere && @$(MAKE) -f Makefile.installer ARCH=x32
+       @$(call echo,Building Installer for Windows...)
+       cd installer && @$(MAKE) ARCH=x32
+       @$(call echo,The Ecere SDK Windows Installer is fully built.)
+endif
+
 clean: emptyoutput
 ifndef LINUX_TARGET
        cd deps && $(MAKE) clean
@@ -677,3 +792,6 @@ troubleshoot:
        @$(call echo,PREFIXLIBDIR=$(PREFIXLIBDIR))
        @$(call echo,ARCH=$(ARCH))
        @$(call echo,ARCH_FLAGS=$(ARCH_FLAGS))
+       @$(call echo,GIT_REPOSITORY=$(GIT_REPOSITORY))
+       @$(call echo,DIR_VER=$(DIR_VER))
+       @$(call echo,REPOSITORY_VER=$(REPOSITORY_VER))