diff --git a/.gitignore b/.gitignore
index c250cc5af2..af25317b42 100644
--- a/.gitignore
+++ b/.gitignore
@@ -60,3 +60,20 @@ dat/
ehthumbs.db
Icon
Thumbs.db
+
+# Generated Bindings
+/bindings/
+
+# Compiled Python
+*.pyc
+*.pyd
+__pycache__/
+
+# CFFI generated source
+_py*.c
+
+# Python Setuptools build and distribution folders.
+/build/
+/dist/
+/.eggs
+/*.egg-info
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
new file mode 100644
index 0000000000..408b377dc8
--- /dev/null
+++ b/.gitlab-ci.yml
@@ -0,0 +1,37 @@
+# Use the official gcc image
+image: ubuntu:18.04
+
+before_script:
+ # Install build dependencies
+ - apt -y update
+ - apt -y install build-essential
+ - apt -y install make
+ - apt -y install zlib1g-dev
+ - apt -y install libpng-dev
+ - apt -y install libjpeg62-dev
+ - apt -y install libgif-dev
+ - apt -y install libncurses5-dev
+ - apt -y install libfreetype6-dev
+ - apt -y install libx11-dev
+ - apt -y install libxrender-dev
+ - apt -y install libgl1-mesa-dev
+ - apt -y install libxext-dev
+ - apt -y install upx-ucl
+ - apt -y install libsqlite3-dev
+ - apt -y install libssl-dev
+ - apt -y install libffi-dev
+ - apt -y install libasound2-dev
+ - apt -y install libcurl4-openssl-dev
+ - apt -y install libfontconfig1-dev
+
+ecere-sdk:
+ # Build the application
+ stage: build
+ script:
+ - make troubleshoot
+ - make print-all-vars-stat
+ - make
+ artifacts:
+ paths:
+ - obj/
+ expire_in: 1 week
diff --git a/.travis.yml b/.travis.yml
index 1ca2cd0a24..1b004aa010 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -10,14 +10,17 @@ compiler:
os:
- linux
- - osx
+# - osx # Travis builds are failing for no obvious reason at the moment
+ - windows
matrix:
exclude:
- os: osx
compiler: gcc
+ - os: windows
+ compiler: clang
allow_failures:
- - os: osx
+ - os:
addons:
apt:
@@ -38,11 +41,31 @@ addons:
- libssl-dev
- libffi-dev
- libasound2-dev
+ - libcurl4-openssl-dev
before_install:
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update ; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install openssl ; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew link openssl --force ; fi
+ - if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then choco install openssl; fi
+ - if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then choco upgrade openssl; fi
+ - if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then export PATH="C:\Program Files\OpenSSL-Win64\bin;":$PATH; fi
+ - if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then wget http://ecere.com/tmp/missingDLLs.7z; fi
+ - if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then "C:/Program Files/7-zip/7z" x missingDLLs.7z ; fi
+ - if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then cp opengl32.dll C:/windows/system32/ ; fi
+ - if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then cp glu32.dll C:/windows/system32/ ; fi
+ - if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then cp ddraw.dll C:/windows/system32/ ; fi
+ - if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then cp dsound.dll C:/windows/system32/ ; fi
+ - if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then cp gnurx-0.dll C:/windows/system32/ ; fi
+ - if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then cp gnurx-0.dll "C:/ProgramData/chocolatey/lib/mingw/tools/install/mingw64/x86_64-w64-mingw32/lib/" ; fi
+ - if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then wget http://www.ecere.com/wordpress/wp-content/uploads/2008/03/regex.h; fi
+ - if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then cp regex.h "C:/ProgramData/chocolatey/lib/mingw/tools/install/mingw64/lib/gcc/x86_64-w64-mingw32/8.1.0/include/" ; fi
+ - if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then wget http://www.ecere.com/tmp/avx512dqintrin.h; fi
+ - if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then wget http://www.ecere.com/tmp/avx512fintrin.h; fi
+ - if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then cp avx512dqintrin.h "C:/ProgramData/chocolatey/lib/mingw/tools/install/mingw64/lib/gcc/x86_64-w64-mingw32/8.1.0/include/" ; fi
+ - if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then cp avx512fintrin.h "C:/ProgramData/chocolatey/lib/mingw/tools/install/mingw64/lib/gcc/x86_64-w64-mingw32/8.1.0/include/" ; fi
+ - if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then mingw32-make MSYSCON=defined OPENSSL_CONF="C:\Program Files\OpenSSL-Win64\bin\openssl.cfg" -j1 V=1 ENABLE_SSL=y troubleshoot; else make -j1 V=1 ENABLE_SSL=y troubleshoot; fi
+ - if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then mingw32-make MSYSCON=defined OPENSSL_CONF="C:\Program Files\OpenSSL-Win64\bin\openssl.cfg" -j1 V=1 ENABLE_SSL=y print-all-vars-stat; else make -j1 V=1 ENABLE_SSL=y print-all-vars-stat; fi
script:
- - make -j1 V=1 ENABLE_SSL=y
+ - if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then mingw32-make MSYSCON=defined OPENSSL_CONF="C:\Program Files\OpenSSL-Win64\bin\openssl.cfg" -j1 V=1 ENABLE_SSL=y; else make -j1 V=1 ENABLE_SSL=y; fi
diff --git a/Cleanfile b/Cleanfile
index ef8f885a80..f31008e0e8 100644
--- a/Cleanfile
+++ b/Cleanfile
@@ -1,4 +1,4 @@
-.PHONY: distclean distclean_all_subdirs
+.PHONY: distclean distclean_all_subdirs distclean_all_subdirs_internal
ifneq ($(V),1)
.SILENT:
endif
@@ -21,26 +21,43 @@ ifeq ($(wildcard $(_SDK_SRC_ROOT)Cleanfile),)
_SDK_SRC_ROOT = $(find_sdk_src_root)
endif
-$(_SDK_SRC_ROOT)Cleanfile: ;
-$(_SDK_SRC_ROOT)crossplatform.mk: ;
-
include $(_SDK_SRC_ROOT)crossplatform.mk
-subdirs := $(sort $(filter-out obj,$(hs_ls_dir)))
+subdirs := $(sort $(filter-out .configs obj __pycache__,$(hs_ls_dir)))
-cd_make_distclean_all_subdirs = $(cd) $(call fp_opt_quotes,$(1)) && $(_MAKE) -f $(_SDK_SRC_ROOT)../Cleanfile _SDK_SRC_ROOT=$(_SDK_SRC_ROOT)../ $(if $(BUILD_DIR),BUILD_DIR=$(BUILD_DIR)$(1)/ ,) distclean distclean_all_subdirs && cd ..
+cd_make_distclean_all_subdirs = $(cd) $(call fp_opt_quotes,$(1)) && $(_MAKE) -f $(_SDK_SRC_ROOT)../Cleanfile _SDK_SRC_ROOT=$(_SDK_SRC_ROOT)../ $(if $(BUILD_DIR),BUILD_DIR=$(BUILD_DIR)$(1)/ ,) distclean distclean_all_subdirs_internal && cd ..
distclean_all_subdirs:
+ $(call echo,This may take a while...)
+ifdef _SDK_SRC_ROOT
+ $(call hs_crossloop,$(subdirs),cd_make_distclean_all_subdirs)
+endif
+ $(call echo,Done.)
+
+distclean_all_subdirs_internal:
ifdef _SDK_SRC_ROOT
$(call hs_crossloop,$(subdirs),cd_make_distclean_all_subdirs)
endif
distclean:
ifdef _SDK_SRC_ROOT
- $(call rmr,obj/)
- $(call rmr,.configs/)
- ifndef KEEP_EWS_FILES
- $(call rm,*.ews)
+ ifndef KEEP_CONFIGS
+ $(if $(wildcard .configs/),$(call rmr,.configs/),)
endif
+ ifndef KEEP_MAKEFILES
$(call rm,*.Makefile)
+ endif
+ ifndef KEEP_OBJS
+ $(if $(wildcard obj/),$(call rmr,obj/),)
+ endif
+ ifndef KEEP_PY
+ $(call rm,_py*.c)
+ $(call rm,_py*.pyd)
+ $(if $(wildcard __pycache__/),$(call rmr,__pycache__/),)
+ endif
+ ifndef KEEP_WORKSPACES
+ $(call rm,*.ews)
+ endif
endif
+
+$(MAKEFILE_LIST): ;
diff --git a/EcereSDK/__init__.py b/EcereSDK/__init__.py
new file mode 100644
index 0000000000..be8dbfb798
--- /dev/null
+++ b/EcereSDK/__init__.py
@@ -0,0 +1,10 @@
+"""attempt at a monolithic ecere package"""
+
+from EcereSDK.eC import *
+from EcereSDK.ecere import *
+from EcereSDK.EDA import *
+
+__all__ = [ 'eC', 'ecere', 'EDA' ]
+
+# wondering if this could be here?
+# app = GuiApplication(appGlobals=globals())
diff --git a/MANIFEST.in b/MANIFEST.in
new file mode 100644
index 0000000000..95cdca8143
--- /dev/null
+++ b/MANIFEST.in
@@ -0,0 +1,27 @@
+exclude .appveyor.yml
+exclude .gitattributes
+exclude .gitignore
+exclude .mailmap
+exclude .travis.yml
+recursive-exclude autoLayout *
+recursive-exclude butterbur *
+recursive-exclude compiler Makefile.bootstrap
+#recursive-exclude doc *
+recursive-exclude ecere Makefile.bootstrap
+recursive-exclude EcereSDK *
+#recursive-exclude epj2make *
+#recursive-exclude ide *
+#recursive-exclude documentor *
+recursive-exclude installer *
+recursive-exclude obj *
+recursive-exclude samples *
+recursive-exclude share *
+#include bindings/py/build_eC.py
+#include bindings/py/build_ecere.py
+#include bindings/py/build_EDA.py
+#include bindings/py/cffi-eC.h
+#include bindings/py/cffi-ecere.h
+#include bindings/py/cffi-EDA.h
+#include bindings/py/eC.h
+#include bindings/py/ecere.h
+#include bindings/py/EDA.h
diff --git a/Makefile b/Makefile
index db30e6f842..46823a3dc5 100644
--- a/Makefile
+++ b/Makefile
@@ -1,13 +1,17 @@
-.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 regenbootstrap updatebootstrap update_ecere update_libec update_ecp update_ecc update_ecs ecereaudio
ifneq ($(V),1)
.SILENT:
endif
-_CF_DIR =
+.PHONY: all clean realclean wipeclean distclean emptyoutput prepinstall actualinstall install copyonlyinstall uninstall troubleshoot outputdirs bootstrap deps ecere ecerecom ecerevanilla ear compiler prepbinaries epj2make libec2 bgen ide documentor eda prepcodeguard codeguard fixprecompile cleantarget pots installer regenbootstrap updatebootstrap update_ecere update_libec update_ecp update_ecc update_ecs ecereaudio
+
+ROOT_ABSPATH := $(dir $(realpath $(firstword $(MAKEFILE_LIST))))
+_CF_DIR = $(ROOT_ABSPATH)
include crossplatform.mk
include default.cf
+.NOTPARALLEL: $(NOT_PARALLEL_TARGETS)
+
ifdef BSD_HOST
INSTALL_FLAGS :=
CPFLAGS := -pRf
@@ -34,6 +38,13 @@ endif
endif
endif
+ifndef DISABLE_EDA_SQLITE
+ EDASQLite := defined
+endif
+ifndef DISABLE_EDA_dBASE
+ EDAdBASE := defined
+endif
+
ifdef WINDOWS_HOST
HOST_SOV := $(HOST_SO)
else
@@ -46,6 +57,8 @@ SOV := $(SO)
ifndef DESTDIR
+ifndef ECERE_SDK_INSTALL_DIR
+
ifeq ($(TARGET_ARCH),x86_64)
ifneq ($(wildcard $(SystemDrive)/Program\ Files ),)
export DESTDIR=$(SystemDrive)/Program Files/Ecere SDK
@@ -64,6 +77,10 @@ else
endif
endif
+else
+ export DESTDIR=$(ECERE_SDK_INSTALL_DIR)
+endif # ECERE_SDK_INSTALL_DIR
+
endif # DESTDIR
export prefix=
@@ -169,17 +186,23 @@ XOBJDIR := obj$(OBJALT)/
XOBJBINDIR := $(OBJDIR)$(HOST_PLATFORM)$(COMPILER_SUFFIX)$(DEBUG_SUFFIX)/bin/
XOBJLIBDIR := $(OBJDIR)$(HOST_PLATFORM)$(COMPILER_SUFFIX)$(DEBUG_SUFFIX)/lib/
-all: prepbinaries ide epj2make documentor eda codeguard ecereaudio
+all: prepbinaries bgen
+ifndef ECERE_PYTHON_PACKAGE
+all: epj2make ide documentor
+endif
+all: eda codeguard ecereaudio
@$(call echo,The Ecere SDK is fully built.)
+include Makefile.bindings
+
outputdirs:
- $(if $(wildcard $(OBJDIR)),,$(call mkdir,$(OBJDIR)))
- $(if $(wildcard $(OBJBINDIR)),,$(call mkdir,$(OBJBINDIR)))
- $(if $(wildcard $(OBJLIBDIR)),,$(call mkdir,$(OBJLIBDIR)))
+ $(call mkdir,$(OBJDIR))
+ $(call mkdir,$(OBJBINDIR))
+ $(call mkdir,$(OBJLIBDIR))
ifdef CROSS_TARGET
- $(if $(wildcard $(XOBJDIR)),,$(call mkdir,$(XOBJDIR)))
- $(if $(wildcard $(XOBJBINDIR)),,$(call mkdir,$(XOBJBINDIR)))
- $(if $(wildcard $(XOBJLIBDIR)),,$(call mkdir,$(XOBJLIBDIR)))
+ $(call mkdir,$(XOBJDIR))
+ $(call mkdir,$(XOBJBINDIR))
+ $(call mkdir,$(XOBJLIBDIR))
endif
bootstrap: outputdirs
@@ -243,35 +266,40 @@ endif
@$(call echo,Building 2nd stage compiler)
+cd compiler && $(_MAKE)
-prepbinaries: compiler ecerecom
+prepbinaries: compiler libec2 ecerecom
@$(call echo,Enabling 2nd stage binaries...)
ifdef WINDOWS_TARGET
$(call cp,ecere/obj/release.$(PLATFORM)$(COMPILER_SUFFIX)$(DEBUG_SUFFIX)/$(LP)ecere$(SOV),$(OBJBINDIR))
$(call cp,ecere/obj/ecereCOM.release.$(PLATFORM)$(COMPILER_SUFFIX)$(DEBUG_SUFFIX)/$(LP)ecereCOM$(SOV),$(OBJBINDIR))
$(call cp,compiler/libec/obj/release.$(PLATFORM)$(COMPILER_SUFFIX)$(DEBUG_SUFFIX)/$(LP)ec$(SOV),$(OBJBINDIR))
+ $(call cp,compiler/libec2/obj/release.$(PLATFORM)$(COMPILER_SUFFIX)$(DEBUG_SUFFIX)/$(LP)ec2$(SOV),$(OBJBINDIR))
endif
ifdef LINUX_TARGET
$(call cp,ecere/obj/release.$(PLATFORM)$(COMPILER_SUFFIX)$(DEBUG_SUFFIX)/$(LP)ecere$(SOV),$(OBJLIBDIR))
$(call cp,ecere/obj/ecereCOM.release.$(PLATFORM)$(COMPILER_SUFFIX)$(DEBUG_SUFFIX)/$(LP)ecereCOM$(SOV),$(OBJLIBDIR))
$(call cp,compiler/libec/obj/release.$(PLATFORM)$(COMPILER_SUFFIX)$(DEBUG_SUFFIX)/$(LP)ec$(SOV),$(OBJLIBDIR))
+ $(call cp,compiler/libec2/obj/release.$(PLATFORM)$(COMPILER_SUFFIX)$(DEBUG_SUFFIX)/$(LP)ec2$(SOV),$(OBJLIBDIR))
ln -sf $(LP)ecere$(SOV) $(OBJLIBDIR)$(LP)ecere$(SO).0
ln -sf $(LP)ecereCOM$(SOV) $(OBJLIBDIR)$(LP)ecereCOM$(SO).0
ln -sf $(LP)ec$(SOV) $(OBJLIBDIR)$(LP)ec$(SO).0
+ ln -sf $(LP)ec2$(SOV) $(OBJLIBDIR)$(LP)ec2$(SO).0
ln -sf $(LP)ecere$(SOV) $(OBJLIBDIR)$(LP)ecere$(SO)
ln -sf $(LP)ecereCOM$(SOV) $(OBJLIBDIR)$(LP)ecereCOM$(SO)
ln -sf $(LP)ec$(SOV) $(OBJLIBDIR)$(LP)ec$(SO)
+ ln -sf $(LP)ec2$(SOV) $(OBJLIBDIR)$(LP)ec2$(SO)
endif
ifndef WINDOWS_TARGET
ifndef LINUX_TARGET
$(call cp,ecere/obj/release.$(PLATFORM)$(COMPILER_SUFFIX)$(DEBUG_SUFFIX)/$(LP)ecere$(SO),$(OBJLIBDIR))
$(call cp,ecere/obj/ecereCOM.release.$(PLATFORM)$(COMPILER_SUFFIX)$(DEBUG_SUFFIX)/$(LP)ecereCOM$(SO),$(OBJLIBDIR))
$(call cp,compiler/libec/obj/release.$(PLATFORM)$(COMPILER_SUFFIX)$(DEBUG_SUFFIX)/$(LP)ec$(SO),$(OBJLIBDIR))
+ $(call cp,compiler/libec2/obj/release.$(PLATFORM)$(COMPILER_SUFFIX)$(DEBUG_SUFFIX)/$(LP)ec2$(SO),$(OBJLIBDIR))
endif
endif
- $(call cp,ear/cmd/obj/release.$(PLATFORM)$(COMPILER_SUFFIX)$(DEBUG_SUFFIX)/ear$(E),$(OBJBINDIR))
- $(call cp,compiler/ecc/obj/release.$(PLATFORM)$(COMPILER_SUFFIX)$(DEBUG_SUFFIX)/ecc$(E),$(OBJBINDIR))
- $(call cp,compiler/ecp/obj/release.$(PLATFORM)$(COMPILER_SUFFIX)$(DEBUG_SUFFIX)/ecp$(E),$(OBJBINDIR))
- $(call cp,compiler/ecs/obj/release.$(PLATFORM)$(COMPILER_SUFFIX)$(DEBUG_SUFFIX)/ecs$(E),$(OBJBINDIR))
+ $(call cp,ear/cmd/obj/release.$(PLATFORM)$(COMPILER_SUFFIX)$(DEBUG_SUFFIX)/ear$(B32_SFX)$(E),$(OBJBINDIR))
+ $(call cp,compiler/ecc/obj/release.$(PLATFORM)$(COMPILER_SUFFIX)$(DEBUG_SUFFIX)/ecc$(B32_SFX)$(E),$(OBJBINDIR))
+ $(call cp,compiler/ecp/obj/release.$(PLATFORM)$(COMPILER_SUFFIX)$(DEBUG_SUFFIX)/ecp$(B32_SFX)$(E),$(OBJBINDIR))
+ $(call cp,compiler/ecs/obj/release.$(PLATFORM)$(COMPILER_SUFFIX)$(DEBUG_SUFFIX)/ecs$(B32_SFX)$(E),$(OBJBINDIR))
ifdef CROSS_TARGET
@@ -279,23 +307,28 @@ ifdef WINDOWS_HOST
$(call cp,ecere/obj/release.$(HOST_PLATFORM)$(COMPILER_SUFFIX)$(DEBUG_SUFFIX)/$(HOST_LP)ecere$(HOST_SOV),$(XOBJBINDIR))
$(call cp,ecere/obj/ecereCOM.release.$(HOST_PLATFORM)$(COMPILER_SUFFIX)$(DEBUG_SUFFIX)/$(HOST_LP)ecereCOM$(HOST_SOV),$(XOBJBINDIR))
$(call cp,compiler/libec/obj/release.$(HOST_PLATFORM)$(COMPILER_SUFFIX)$(DEBUG_SUFFIX)/$(HOST_LP)ec$(HOST_SOV),$(XOBJBINDIR))
+ $(call cp,compiler/libec2/obj/release.$(HOST_PLATFORM)$(COMPILER_SUFFIX)$(DEBUG_SUFFIX)/$(HOST_LP)ec2$(HOST_SOV),$(XOBJBINDIR))
endif
ifdef WINDOWS_HOST
$(call cp,ecere/obj/release.$(HOST_PLATFORM)$(COMPILER_SUFFIX)$(DEBUG_SUFFIX)/$(HOST_LP)ecere$(HOST_SOV),$(XOBJLIBDIR))
$(call cp,ecere/obj/ecereCOM.release.$(HOST_PLATFORM)$(COMPILER_SUFFIX)$(DEBUG_SUFFIX)/$(HOST_LP)ecereCOM$(HOST_SOV),$(XOBJLIBDIR))
$(call cp,compiler/libec/obj/release.$(HOST_PLATFORM)$(COMPILER_SUFFIX)$(DEBUG_SUFFIX)/$(HOST_LP)ec$(HOST_SOV),$(XOBJLIBDIR))
+ $(call cp,compiler/libec2/obj/release.$(HOST_PLATFORM)$(COMPILER_SUFFIX)$(DEBUG_SUFFIX)/$(HOST_LP)ec2$(HOST_SOV),$(XOBJLIBDIR))
ln -sf $(HOST_LP)ecere$(HOST_SOV) $(XOBJLIBDIR)$(LP)ecere$(HOST_SO).0
ln -sf $(HOST_LP)ecereCOM$(HOST_SOV) $(XOBJLIBDIR)$(LP)ecereCOM$(HOST_SO).0
ln -sf $(HOST_LP)ec$(HOST_SOV) $(XOBJLIBDIR)$(LP)ec$(HOST_SO).0
+ ln -sf $(HOST_LP)ec2$(HOST_SOV) $(XOBJLIBDIR)$(LP)ec2$(HOST_SO).0
ln -sf $(HOST_LP)ecere$(HOST_SOV) $(XOBJLIBDIR)$(LP)ecere$(HOST_SO)
ln -sf $(HOST_LP)ecereCOM$(HOST_SOV) $(XOBJLIBDIR)$(LP)ecereCOM$(HOST_SO)
ln -sf $(HOST_LP)ec$(HOST_SOV) $(XOBJLIBDIR)$(LP)ec$(HOST_SO)
+ ln -sf $(HOST_LP)ec2$(HOST_SOV) $(XOBJLIBDIR)$(LP)ec2$(HOST_SO)
endif
ifndef WINDOWS_HOST
ifndef LINUX_HOST
$(call cp,ecere/obj/release.$(HOST_PLATFORM)$(COMPILER_SUFFIX)$(DEBUG_SUFFIX)/$(HOST_LP)ecere$(HOST_SO),$(XOBJLIBDIR))
$(call cp,ecere/obj/ecereCOM.release.$(HOST_PLATFORM)$(COMPILER_SUFFIX)$(DEBUG_SUFFIX)/$(HOST_LP)ecereCOM$(HOST_SO),$(XOBJLIBDIR))
$(call cp,compiler/libec/obj/release.$(HOST_PLATFORM)$(COMPILER_SUFFIX)$(DEBUG_SUFFIX)/$(HOST_LP)ec$(HOST_SO),$(XOBJLIBDIR))
+ $(call cp,compiler/libec2/obj/release.$(HOST_PLATFORM)$(COMPILER_SUFFIX)$(DEBUG_SUFFIX)/$(HOST_LP)ec2$(HOST_SO),$(XOBJLIBDIR))
endif
endif
$(call cp,ear/cmd/obj/release.$(HOST_PLATFORM)$(COMPILER_SUFFIX)$(DEBUG_SUFFIX)/ear$(HOST_E),$(XOBJBINDIR))
@@ -309,6 +342,14 @@ epj2make: prepbinaries
@$(call echo,Building epj2make...)
+cd epj2make && $(_MAKE)
+libec2: compiler
+ @$(call echo,Building libec2...)
+ +cd compiler/libec2 && $(_MAKE)
+
+bgen: prepbinaries
+ @$(call echo,Building bgen...)
+ +cd bgen && $(_MAKE)
+
ecereaudio: prepbinaries
ifneq ($(ECERE_AUDIO),n)
@$(call echo,Building EcereAudio...)
@@ -362,7 +403,12 @@ emptyoutput: outputdirs
$(call rm,$(SODESTDIR)$(LP)ecereCOM$(SO))
$(call rm,$(SODESTDIR)$(LP)ec$(SO))
$(call rm,$(SODESTDIR)$(LP)EDA$(SO))
+ifdef EDAdBASE
+ $(call rm,$(SODESTDIR)$(LP)EDAdBASE$(SO))
+endif
+ifdef EDASQLite
$(call rm,$(SODESTDIR)$(LP)EDASQLite$(SO))
+endif
ifdef EDASQLiteCipher
$(call rm,$(SODESTDIR)$(LP)EDASQLiteCipher$(SO))
endif
@@ -374,7 +420,12 @@ ifdef LINUX_TARGET
$(call rm,$(SODESTDIR)$(LP)ecereCOM$(SO).0)
$(call rm,$(SODESTDIR)$(LP)ec$(SO).0)
$(call rm,$(SODESTDIR)$(LP)EDA$(SO).0)
+ifdef EDAdBASE
+ $(call rm,$(SODESTDIR)$(LP)EDAdBASE$(SO).0)
+endif
+ifdef EDASQLite
$(call rm,$(SODESTDIR)$(LP)EDASQLite$(SO).0)
+endif
ifdef EDASQLiteCipher
$(call rm,$(SODESTDIR)$(LP)EDASQLiteCipher$(SO).0)
endif
@@ -384,8 +435,14 @@ endif
$(call rm,$(SODESTDIR)$(LP)ecere$(SOV))
$(call rm,$(SODESTDIR)$(LP)ecereCOM$(SOV))
$(call rm,$(SODESTDIR)$(LP)ec$(SOV))
+ $(call rm,$(SODESTDIR)$(LP)ec2$(SOV))
$(call rm,$(SODESTDIR)$(LP)EDA$(SOV))
+ifdef EDAdBASE
+ $(call rm,$(SODESTDIR)$(LP)EDAdBASE$(SOV))
+endif
+ifdef EDASQLite
$(call rm,$(SODESTDIR)$(LP)EDASQLite$(SOV))
+endif
ifdef EDASQLiteCipher
$(call rm,$(SODESTDIR)$(LP)EDASQLiteCipher$(SOV))
endif
@@ -393,11 +450,12 @@ ifneq ($(ECERE_AUDIO),n)
$(call rm,$(SODESTDIR)$(LP)EcereAudio$(SOV))
endif
endif
- $(call rm,$(OBJBINDIR)ear$(E))
- $(call rm,$(OBJBINDIR)ecc$(E))
- $(call rm,$(OBJBINDIR)ecp$(E))
- $(call rm,$(OBJBINDIR)ecs$(E))
+ $(call rm,$(OBJBINDIR)ear$(B32_SFX)$(E))
+ $(call rm,$(OBJBINDIR)ecc$(B32_SFX)$(E))
+ $(call rm,$(OBJBINDIR)ecp$(B32_SFX)$(E))
+ $(call rm,$(OBJBINDIR)ecs$(B32_SFX)$(E))
$(call rm,$(OBJBINDIR)epj2make$(E))
+ $(call rm,$(OBJBINDIR)bgen$(E))
$(call rm,$(OBJBINDIR)ecere-ide$(E))
$(call rm,$(OBJBINDIR)documentor$(E))
ifdef CodeGuard
@@ -411,6 +469,8 @@ cleantarget:
+cd ecere && $(_MAKE) cleantarget
+cd eda && $(_MAKE) cleantarget
+cd epj2make && $(_MAKE) cleantarget
+ +cd compiler/libec2 && $(_MAKE) cleantarget
+ +cd bgen && $(_MAKE) cleantarget
+cd ide && $(_MAKE) cleantarget
+cd installer && $(_MAKE) cleantarget
ifneq ($(ECERE_AUDIO),n)
@@ -432,7 +492,7 @@ installer:
@$(call echo,The Ecere SDK Windows Installer is fully built.)
endif
-clean: emptyoutput
+clean: emptyoutput bindings_clean
ifndef LINUX_TARGET
+cd deps && $(_MAKE) clean
endif
@@ -440,6 +500,8 @@ endif
+cd compiler && $(_MAKE) clean
+cd ear && $(_MAKE) clean
+cd epj2make && $(_MAKE) clean
+ +cd compiler/libec2 && $(_MAKE) clean
+ +cd bgen && $(_MAKE) clean
+cd ide && $(_MAKE) clean
+cd documentor && $(_MAKE) clean
ifneq ($(ECERE_AUDIO),n)
@@ -451,7 +513,7 @@ endif
+cd eda && $(_MAKE) clean
@$(call echo,Done.)
-realclean: outputdirs
+realclean: bindings_realclean
ifndef LINUX_TARGET
+cd deps && $(_MAKE) realclean
endif
@@ -459,6 +521,8 @@ endif
+cd compiler && $(_MAKE) realclean
+cd ear && $(_MAKE) realclean
+cd epj2make && $(_MAKE) realclean
+ +cd compiler/libec2 && $(_MAKE) realclean
+ +cd bgen && $(_MAKE) realclean
+cd ide && $(_MAKE) realclean
+cd documentor && $(_MAKE) realclean
ifneq ($(ECERE_AUDIO),n)
@@ -471,30 +535,58 @@ endif
$(call rmr,obj/$(PLATFORM)/)
@$(call echo,Done.)
-distclean:
- $(MAKE) -f Cleanfile distclean distclean_all_subdirs
+wipeclean: bindings_wipeclean
+ $(call rmr,obj/)
+ +cd deps && $(_MAKE) wipeclean
+ +cd ecere && $(_MAKE) wipeclean
+ +cd compiler && $(_MAKE) wipeclean
+ +cd ear && $(_MAKE) wipeclean
+ +cd epj2make && $(_MAKE) wipeclean
+ +cd compiler/libec2 && $(_MAKE) wipeclean
+ +cd bgen && $(_MAKE) wipeclean
+ +cd ide && $(_MAKE) wipeclean
+ +cd documentor && $(_MAKE) wipeclean
+ +cd audio && $(_MAKE) wipeclean
+ +cd eda && $(_MAKE) wipeclean
+ @$(call echo,Done.)
+
+distclean: bindings_distclean
+ $(_MAKE) -f Cleanfile distclean distclean_all_subdirs
@$(call echo,Done.)
DOC = doc
-Makefile: ;
-crossplatform.mk: ;
-default.cf: ;
+$(MAKEFILE_LIST): ;
+$(SOURCES): ;
+$(RESOURCES): ;
BINARIES = \
ecere/obj/release.$(PLATFORM)$(COMPILER_SUFFIX)$(DEBUG_SUFFIX)/$(LP)ecere$(SOV) \
ecere/obj/ecereCOM.release.$(PLATFORM)$(COMPILER_SUFFIX)$(DEBUG_SUFFIX)/$(LP)ecereCOM$(SOV) \
ecere/obj/vanilla.$(PLATFORM)$(COMPILER_SUFFIX)$(DEBUG_SUFFIX)/libecereVanilla$(A) \
compiler/libec/obj/release.$(PLATFORM)$(COMPILER_SUFFIX)$(DEBUG_SUFFIX)/$(LP)ec$(SOV) \
- compiler/ecp/obj/release.$(PLATFORM)$(COMPILER_SUFFIX)$(DEBUG_SUFFIX)/ecp$(E) \
- compiler/ecc/obj/release.$(PLATFORM)$(COMPILER_SUFFIX)$(DEBUG_SUFFIX)/ecc$(E) \
- compiler/ecs/obj/release.$(PLATFORM)$(COMPILER_SUFFIX)$(DEBUG_SUFFIX)/ecs$(E) \
- ear/cmd/obj/release.$(PLATFORM)$(COMPILER_SUFFIX)$(DEBUG_SUFFIX)/ear$(E) \
+ compiler/libec2/obj/release.$(PLATFORM)$(COMPILER_SUFFIX)$(DEBUG_SUFFIX)/$(LP)ec2$(SOV) \
+ compiler/ecp/obj/release.$(PLATFORM)$(COMPILER_SUFFIX)$(DEBUG_SUFFIX)/ecp$(B32_SFX)$(E) \
+ compiler/ecc/obj/release.$(PLATFORM)$(COMPILER_SUFFIX)$(DEBUG_SUFFIX)/ecc$(B32_SFX)$(E) \
+ compiler/ecs/obj/release.$(PLATFORM)$(COMPILER_SUFFIX)$(DEBUG_SUFFIX)/ecs$(B32_SFX)$(E) \
+ ear/cmd/obj/release.$(PLATFORM)$(COMPILER_SUFFIX)$(DEBUG_SUFFIX)/ear$(B32_SFX)$(E) \
+ bgen/obj/release.$(PLATFORM)$(COMPILER_SUFFIX)$(DEBUG_SUFFIX)/bgen$(E) \
+ eda/libeda/obj/release.$(PLATFORM)$(COMPILER_SUFFIX)$(DEBUG_SUFFIX)/$(LP)EDA$(SOV)
+
+ifdef EDAdBASE
+BINARIES += eda/drivers/dbase/obj/release.$(PLATFORM)$(COMPILER_SUFFIX)$(DEBUG_SUFFIX)/$(LP)EDAdBASE$(SOV)
+endif
+ifdef EDASQLite
+BINARIES += \
+ eda/drivers/sqlite/obj/release.$(PLATFORM)$(COMPILER_SUFFIX)$(DEBUG_SUFFIX)/$(LP)EDASQLite$(SOV)
+endif
+
+ifndef ECERE_PYTHON_PACKAGE
+BINARIES += \
epj2make/obj/release.$(PLATFORM)$(COMPILER_SUFFIX)$(DEBUG_SUFFIX)/epj2make$(E) \
documentor/obj/release.$(PLATFORM)$(COMPILER_SUFFIX)$(DEBUG_SUFFIX)/documentor$(E) \
- ide/obj/release.$(PLATFORM)$(COMPILER_SUFFIX)$(DEBUG_SUFFIX)/ecere-ide$(E) \
- eda/libeda/obj/release.$(PLATFORM)$(COMPILER_SUFFIX)$(DEBUG_SUFFIX)/$(LP)EDA$(SOV) \
- eda/drivers/sqlite/obj/release.$(PLATFORM)$(COMPILER_SUFFIX)$(DEBUG_SUFFIX)/$(LP)EDASQLite$(SOV)
+ ide/obj/release.$(PLATFORM)$(COMPILER_SUFFIX)$(DEBUG_SUFFIX)/ecere-ide$(E)
+endif
ifneq ($(ECERE_AUDIO),n)
BINARIES += audio/obj/release.$(PLATFORM)$(COMPILER_SUFFIX)$(DEBUG_SUFFIX)/$(LP)EcereAudio$(SOV)
@@ -508,6 +600,14 @@ ifdef EDASQLiteCipher
BINARIES += eda/drivers/sqliteCipher/obj/release.$(PLATFORM)$(COMPILER_SUFFIX)$(DEBUG_SUFFIX)/$(LP)EDASQLiteCipher$(SOV)
endif
+OBJPYDIR := $(OBJDIR)$(PLATFORM)$(COMPILER_SUFFIX)$(DEBUG_SUFFIX)/py
+
+.PHONY: py_prepinstall
+py_prepinstall: prepinstall
+ $(call mkdir,$(call path,$(OBJPYDIR)/))
+ $(call cp,ecere/obj/ecereCOM.release.$(PLATFORM)$(COMPILER_SUFFIX)$(DEBUG_SUFFIX)/$(LP)ecereCOM$(SOV),$(OBJPYDIR)/$(LP)ecereCOM$(SO))
+ $(call cp,ecere/obj/release.$(PLATFORM)$(COMPILER_SUFFIX)$(DEBUG_SUFFIX)/$(LP)ecere$(SOV),$(OBJPYDIR)/$(LP)ecere$(SO))
+
# Making sure everything is in $(OBJBINDIR) and $(OBJLIBDIR)
# Shared Libraries (in $(OBJBINDIR) on Windows and $(OBJLIBDIR) otherwise)
# Symlinks for libs on Linux
@@ -518,8 +618,14 @@ ifdef WINDOWS_TARGET
$(call cp,ecere/obj/release.$(PLATFORM)$(COMPILER_SUFFIX)$(DEBUG_SUFFIX)/$(LP)ecere$(SO),$(OBJBINDIR))
$(call cp,ecere/obj/ecereCOM.release.$(PLATFORM)$(COMPILER_SUFFIX)$(DEBUG_SUFFIX)/$(LP)ecereCOM$(SO),$(OBJBINDIR))
$(call cp,compiler/libec/obj/release.$(PLATFORM)$(COMPILER_SUFFIX)$(DEBUG_SUFFIX)/$(LP)ec$(SO),$(OBJBINDIR))
+ $(call cp,compiler/libec2/obj/release.$(PLATFORM)$(COMPILER_SUFFIX)$(DEBUG_SUFFIX)/$(LP)ec2$(SO),$(OBJBINDIR))
$(call cp,eda/libeda/obj/release.$(PLATFORM)$(COMPILER_SUFFIX)$(DEBUG_SUFFIX)/$(LP)EDA$(SO),$(OBJBINDIR))
+ifdef EDAdBASE
+ $(call cp,eda/drivers/dbase/obj/release.$(PLATFORM)$(COMPILER_SUFFIX)$(DEBUG_SUFFIX)/$(LP)EDAdBASE$(SO),$(OBJBINDIR))
+endif
+ifdef EDASQLite
$(call cp,eda/drivers/sqlite/obj/release.$(PLATFORM)$(COMPILER_SUFFIX)$(DEBUG_SUFFIX)/$(LP)EDASQLite$(SO),$(OBJBINDIR))
+endif
ifneq ($(ECERE_AUDIO),n)
$(call cp,audio/obj/release.$(PLATFORM)$(COMPILER_SUFFIX)$(DEBUG_SUFFIX)/$(LP)EcereAudio$(SO),$(OBJBINDIR))
endif
@@ -532,8 +638,14 @@ ifdef LINUX_TARGET
$(call cp,ecere/obj/release.$(PLATFORM)$(COMPILER_SUFFIX)$(DEBUG_SUFFIX)/$(LP)ecere$(SOV),$(OBJLIBDIR))
$(call cp,ecere/obj/ecereCOM.release.$(PLATFORM)$(COMPILER_SUFFIX)$(DEBUG_SUFFIX)/$(LP)ecereCOM$(SOV),$(OBJLIBDIR))
$(call cp,compiler/libec/obj/release.$(PLATFORM)$(COMPILER_SUFFIX)$(DEBUG_SUFFIX)/$(LP)ec$(SOV),$(OBJLIBDIR))
+ $(call cp,compiler/libec2/obj/release.$(PLATFORM)$(COMPILER_SUFFIX)$(DEBUG_SUFFIX)/$(LP)ec2$(SOV),$(OBJLIBDIR))
$(call cp,eda/libeda/obj/release.$(PLATFORM)$(COMPILER_SUFFIX)$(DEBUG_SUFFIX)/$(LP)EDA$(SOV),$(OBJLIBDIR))
+ifdef EDAdBASE
+ $(call cp,eda/drivers/dbase/obj/release.$(PLATFORM)$(COMPILER_SUFFIX)$(DEBUG_SUFFIX)/$(LP)EDAdBASE$(SOV),$(OBJLIBDIR))
+endif
+ifdef EDASQLite
$(call cp,eda/drivers/sqlite/obj/release.$(PLATFORM)$(COMPILER_SUFFIX)$(DEBUG_SUFFIX)/$(LP)EDASQLite$(SOV),$(OBJLIBDIR))
+endif
ifneq ($(ECERE_AUDIO),n)
$(call cp,audio/obj/release.$(PLATFORM)$(COMPILER_SUFFIX)$(DEBUG_SUFFIX)/$(LP)EcereAudio$(SOV),$(OBJLIBDIR))
endif
@@ -543,8 +655,14 @@ endif
ln -sf $(LP)ecere$(SOV) $(OBJLIBDIR)$(LP)ecere$(SO).0
ln -sf $(LP)ecereCOM$(SOV) $(OBJLIBDIR)$(LP)ecereCOM$(SO).0
ln -sf $(LP)ec$(SOV) $(OBJLIBDIR)$(LP)ec$(SO).0
+ ln -sf $(LP)ec2$(SOV) $(OBJLIBDIR)$(LP)ec2$(SO).0
ln -sf $(LP)EDA$(SOV) $(OBJLIBDIR)$(LP)EDA$(SO).0
+ifdef EDAdBASE
+ ln -sf $(LP)EDAdBASE$(SOV) $(OBJLIBDIR)$(LP)EDAdBASE$(SO).0
+endif
+ifdef EDASQLite
ln -sf $(LP)EDASQLite$(SOV) $(OBJLIBDIR)$(LP)EDASQLite$(SO).0
+endif
ifdef EDASQLiteCipher
ln -sf $(LP)EDASQLiteCipher$(SOV) $(OBJLIBDIR)$(LP)EDASQLiteCipher$(SO).0
endif
@@ -555,8 +673,14 @@ endif
ln -sf $(LP)ecere$(SOV) $(OBJLIBDIR)$(LP)ecere$(SO)
ln -sf $(LP)ecereCOM$(SOV) $(OBJLIBDIR)$(LP)ecereCOM$(SO)
ln -sf $(LP)ec$(SOV) $(OBJLIBDIR)$(LP)ec$(SO)
+ ln -sf $(LP)ec2$(SOV) $(OBJLIBDIR)$(LP)ec2$(SO)
ln -sf $(LP)EDA$(SOV) $(OBJLIBDIR)$(LP)EDA$(SO)
+ifdef EDAdBASE
+ ln -sf $(LP)EDAdBASE$(SOV) $(OBJLIBDIR)$(LP)EDAdBASE$(SO)
+endif
+ifdef EDASQLite
ln -sf $(LP)EDASQLite$(SOV) $(OBJLIBDIR)$(LP)EDASQLite$(SO)
+endif
ifdef EDASQLiteCipher
ln -sf $(LP)EDASQLiteCipher$(SOV) $(OBJLIBDIR)$(LP)EDASQLiteCipher$(SO)
endif
@@ -568,8 +692,14 @@ ifndef LINUX_TARGET
$(call cp,ecere/obj/release.$(PLATFORM)$(COMPILER_SUFFIX)$(DEBUG_SUFFIX)/$(LP)ecere$(SO),$(OBJLIBDIR))
$(call cp,ecere/obj/ecereCOM.release.$(PLATFORM)$(COMPILER_SUFFIX)$(DEBUG_SUFFIX)/$(LP)ecereCOM$(SO),$(OBJLIBDIR))
$(call cp,compiler/libec/obj/release.$(PLATFORM)$(COMPILER_SUFFIX)$(DEBUG_SUFFIX)/$(LP)ec$(SO),$(OBJLIBDIR))
+ $(call cp,compiler/libec2/obj/release.$(PLATFORM)$(COMPILER_SUFFIX)$(DEBUG_SUFFIX)/$(LP)ec2$(SO),$(OBJLIBDIR))
$(call cp,eda/libeda/obj/release.$(PLATFORM)$(COMPILER_SUFFIX)$(DEBUG_SUFFIX)/$(LP)EDA$(SO),$(OBJLIBDIR))
+ifdef EDAdBASE
+ $(call cp,eda/drivers/dbase/obj/release.$(PLATFORM)$(COMPILER_SUFFIX)$(DEBUG_SUFFIX)/$(LP)EDAdBASE$(SO),$(OBJLIBDIR))
+endif
+ifdef EDASQLite
$(call cp,eda/drivers/sqlite/obj/release.$(PLATFORM)$(COMPILER_SUFFIX)$(DEBUG_SUFFIX)/$(LP)EDASQLite$(SO),$(OBJLIBDIR))
+endif
ifneq ($(ECERE_AUDIO),n)
$(call cp,audio/obj/release.$(PLATFORM)$(COMPILER_SUFFIX)$(DEBUG_SUFFIX)/$(LP)EcereAudio$(SO),$(OBJLIBDIR))
endif
@@ -579,13 +709,16 @@ endif
endif
endif
+ $(call cp,ear/cmd/obj/release.$(PLATFORM)$(COMPILER_SUFFIX)$(DEBUG_SUFFIX)/ear$(B32_SFX)$(E),$(OBJBINDIR))
+ $(call cp,compiler/ecc/obj/release.$(PLATFORM)$(COMPILER_SUFFIX)$(DEBUG_SUFFIX)/ecc$(B32_SFX)$(E),$(OBJBINDIR))
+ $(call cp,compiler/ecp/obj/release.$(PLATFORM)$(COMPILER_SUFFIX)$(DEBUG_SUFFIX)/ecp$(B32_SFX)$(E),$(OBJBINDIR))
+ $(call cp,compiler/ecs/obj/release.$(PLATFORM)$(COMPILER_SUFFIX)$(DEBUG_SUFFIX)/ecs$(B32_SFX)$(E),$(OBJBINDIR))
+ $(call cp,bgen/obj/release.$(PLATFORM)$(COMPILER_SUFFIX)$(DEBUG_SUFFIX)/bgen$(E),$(OBJBINDIR))
+ifndef ECERE_PYTHON_PACKAGE
$(call cp,ide/obj/release.$(PLATFORM)$(COMPILER_SUFFIX)$(DEBUG_SUFFIX)/ecere-ide$(E),$(OBJBINDIR))
- $(call cp,ear/cmd/obj/release.$(PLATFORM)$(COMPILER_SUFFIX)$(DEBUG_SUFFIX)/ear$(E),$(OBJBINDIR))
- $(call cp,compiler/ecc/obj/release.$(PLATFORM)$(COMPILER_SUFFIX)$(DEBUG_SUFFIX)/ecc$(E),$(OBJBINDIR))
- $(call cp,compiler/ecp/obj/release.$(PLATFORM)$(COMPILER_SUFFIX)$(DEBUG_SUFFIX)/ecp$(E),$(OBJBINDIR))
- $(call cp,compiler/ecs/obj/release.$(PLATFORM)$(COMPILER_SUFFIX)$(DEBUG_SUFFIX)/ecs$(E),$(OBJBINDIR))
$(call cp,epj2make/obj/release.$(PLATFORM)$(COMPILER_SUFFIX)$(DEBUG_SUFFIX)/epj2make$(E),$(OBJBINDIR))
$(call cp,documentor/obj/release.$(PLATFORM)$(COMPILER_SUFFIX)$(DEBUG_SUFFIX)/documentor$(E),$(OBJBINDIR))
+endif
ifdef CodeGuard
$(call cp,codeGuard/obj/release.$(PLATFORM)$(COMPILER_SUFFIX)$(DEBUG_SUFFIX)/CodeGuard$(E),$(OBJBINDIR))
endif
@@ -600,14 +733,20 @@ copyonlyinstall: actualinstall
actualinstall:
ifdef WINDOWS_TARGET
- $(call mkdir,"$(BINDIR)/")
- $(call mkdir,"$(DESTSLIBDIR)/")
- $(call mkdir,"$(DOCDIR)/")
+ $(call mkdir,$(call path,$(BINDIR)/))
+ $(call mkdir,$(call path,$(DESTSLIBDIR)/))
+ $(call mkdir,$(call path,$(DOCDIR)/))
$(call cp,$(OBJBINDIR)$(LP)ecere$(SO),"$(DESTLIBDIR)/")
$(call cp,$(OBJBINDIR)$(LP)ecereCOM$(SO),"$(DESTLIBDIR)/")
$(call cp,$(OBJBINDIR)$(LP)ec$(SO),"$(DESTLIBDIR)/")
+ $(call cp,$(OBJBINDIR)$(LP)ec2$(SO),"$(DESTLIBDIR)/")
$(call cp,$(OBJBINDIR)$(LP)EDA$(SO),"$(DESTLIBDIR)/")
+ifdef EDAdBASE
+ $(call cp,$(OBJBINDIR)$(LP)EDAdBASE$(SO),"$(DESTLIBDIR)/")
+endif
+ifdef EDASQLite
$(call cp,$(OBJBINDIR)$(LP)EDASQLite$(SO),"$(DESTLIBDIR)/")
+endif
ifdef EDASQLiteCipher
$(call cp,$(OBJBINDIR)$(LP)EDASQLiteCipher$(SO),"$(DESTLIBDIR)/")
endif
@@ -615,11 +754,12 @@ ifneq ($(ECERE_AUDIO),n)
$(call cp,$(OBJBINDIR)$(LP)EcereAudio$(SO),"$(DESTLIBDIR)/")
endif
$(call cp,$(OBJBINDIR)ecere-ide$(E),"$(BINDIR)/")
- $(call cp,$(OBJBINDIR)ear$(E),"$(BINDIR)/")
- $(call cp,$(OBJBINDIR)ecc$(E),"$(BINDIR)/")
- $(call cp,$(OBJBINDIR)ecp$(E),"$(BINDIR)/")
- $(call cp,$(OBJBINDIR)ecs$(E),"$(BINDIR)/")
+ $(call cp,$(OBJBINDIR)ear$(B32_SFX)$(E),"$(BINDIR)/")
+ $(call cp,$(OBJBINDIR)ecc$(B32_SFX)$(E),"$(BINDIR)/")
+ $(call cp,$(OBJBINDIR)ecp$(B32_SFX)$(E),"$(BINDIR)/")
+ $(call cp,$(OBJBINDIR)ecs$(B32_SFX)$(E),"$(BINDIR)/")
$(call cp,$(OBJBINDIR)epj2make$(E),"$(BINDIR)/")
+ $(call cp,$(OBJBINDIR)bgen$(E),"$(BINDIR)/")
$(call cp,$(OBJBINDIR)documentor$(E),"$(BINDIR)/")
ifdef CodeGuard
$(call cp,$(OBJBINDIR)CodeGuard$(E),"$(BINDIR)/")
@@ -635,8 +775,14 @@ ifdef OSX_TARGET
install $(OBJLIBDIR)$(LP)ecere$(SO) $(DESTLIBDIR)/
install $(OBJLIBDIR)$(LP)ecereCOM$(SO) $(DESTLIBDIR)/
install $(OBJLIBDIR)$(LP)ec$(SO) $(DESTLIBDIR)/
+ install $(OBJLIBDIR)$(LP)ec2$(SO) $(DESTLIBDIR)/
install $(OBJLIBDIR)$(LP)EDA$(SO) $(DESTLIBDIR)/
+ifdef EDAdBASE
+ install $(OBJLIBDIR)$(LP)EDAdBASE$(SO) $(DESTLIBDIR)/
+endif
+ifdef EDASQLite
install $(OBJLIBDIR)$(LP)EDASQLite$(SO) $(DESTLIBDIR)/
+endif
ifdef EDASQLiteCipher
install $(OBJLIBDIR)$(LP)EDASQLiteCipher$(SO) $(DESTLIBDIR)/
endif
@@ -644,11 +790,12 @@ ifneq ($(ECERE_AUDIO),n)
install $(OBJLIBDIR)$(LP)EcereAudio$(SO) $(DESTLIBDIR)/
endif
install $(OBJBINDIR)ecere-ide$(E) $(BINDIR)/
- install $(OBJBINDIR)ear$(E) $(BINDIR)/
- install $(OBJBINDIR)ecc$(E) $(BINDIR)/
- install $(OBJBINDIR)ecp$(E) $(BINDIR)/
- install $(OBJBINDIR)ecs$(E) $(BINDIR)/
+ install $(OBJBINDIR)ear$(B32_SFX)$(E) $(BINDIR)/
+ install $(OBJBINDIR)ecc$(B32_SFX)$(E) $(BINDIR)/
+ install $(OBJBINDIR)ecp$(B32_SFX)$(E) $(BINDIR)/
+ install $(OBJBINDIR)ecs$(B32_SFX)$(E) $(BINDIR)/
install $(OBJBINDIR)epj2make$(E) $(BINDIR)/
+ install $(OBJBINDIR)bgen$(E) $(BINDIR)/
install $(OBJBINDIR)documentor$(E) $(BINDIR)/
ifdef CodeGuard
install $(OBJBINDIR)CodeGuard$(E) $(BINDIR)/
@@ -677,8 +824,14 @@ ifdef LINUX_TARGET
install $(INSTALL_FLAGS) $(OBJLIBDIR)$(LP)ecere$(SOV) $(DESTLIBDIR)/$(LP)ecere$(SOV)
install $(INSTALL_FLAGS) $(OBJLIBDIR)$(LP)ecereCOM$(SOV) $(DESTLIBDIR)/$(LP)ecereCOM$(SOV)
install $(INSTALL_FLAGS) $(OBJLIBDIR)$(LP)ec$(SOV) $(DESTLIBDIR)/ec/$(LP)ec$(SOV)
+ install $(INSTALL_FLAGS) $(OBJLIBDIR)$(LP)ec2$(SOV) $(DESTLIBDIR)/ec/$(LP)ec2$(SOV)
install $(INSTALL_FLAGS) $(OBJLIBDIR)$(LP)EDA$(SOV) $(DESTLIBDIR)/ec/$(LP)EDA$(SOV)
+ifdef EDAdBASE
+ install $(INSTALL_FLAGS) $(OBJLIBDIR)$(LP)EDAdBASE$(SOV) $(DESTLIBDIR)/ec/$(LP)EDAdBASE$(SOV)
+endif
+ifdef EDASQLite
install $(INSTALL_FLAGS) $(OBJLIBDIR)$(LP)EDASQLite$(SOV) $(DESTLIBDIR)/ec/$(LP)EDASQLite$(SOV)
+endif
ifdef EDASQLiteCipher
install $(INSTALL_FLAGS) $(OBJLIBDIR)$(LP)EDASQLiteCipher$(SOV) $(DESTLIBDIR)/ec/$(LP)EDASQLiteCipher$(SOV)
endif
@@ -688,8 +841,14 @@ endif
ln -sf $(LP)ecere$(SOV) $(DESTLIBDIR)/$(LP)ecere$(SO).0
ln -sf $(LP)ecereCOM$(SOV) $(DESTLIBDIR)/$(LP)ecereCOM$(SO).0
ln -sf $(LP)ec$(SOV) $(DESTLIBDIR)/ec/$(LP)ec$(SO).0
+ ln -sf $(LP)ec2$(SOV) $(DESTLIBDIR)/ec/$(LP)ec2$(SO).0
ln -sf $(LP)EDA$(SOV) $(DESTLIBDIR)/ec/$(LP)EDA$(SO).0
+ifdef EDAdBASE
+ ln -sf $(LP)EDAdBASE$(SOV) $(DESTLIBDIR)/ec/$(LP)EDAdBASE$(SO).0
+endif
+ifdef EDASQLite
ln -sf $(LP)EDASQLite$(SOV) $(DESTLIBDIR)/ec/$(LP)EDASQLite$(SO).0
+endif
ifdef EDASQLiteCipher
ln -sf $(LP)EDASQLiteCipher$(SOV) $(DESTLIBDIR)/ec/$(LP)EDASQLiteCipher$(SO).0
endif
@@ -699,8 +858,14 @@ endif
ln -sf $(LP)ecere$(SOV) $(DESTLIBDIR)/$(LP)ecere$(SO)
ln -sf $(LP)ecereCOM$(SOV) $(DESTLIBDIR)/$(LP)ecereCOM$(SO)
ln -sf $(LP)ec$(SOV) $(DESTLIBDIR)/ec/$(LP)ec$(SO)
+ ln -sf $(LP)ec2$(SOV) $(DESTLIBDIR)/ec/$(LP)ec2$(SO)
ln -sf $(LP)EDA$(SOV) $(DESTLIBDIR)/ec/$(LP)EDA$(SO)
+ifdef EDAdBASE
+ ln -sf $(LP)EDAdBASE$(SOV) $(DESTLIBDIR)/ec/$(LP)EDAdBASE$(SO)
+endif
+ifdef EDASQLite
ln -sf $(LP)EDASQLite$(SOV) $(DESTLIBDIR)/ec/$(LP)EDASQLite$(SO)
+endif
ln -sf ../$(LP)ecere$(SOV) $(DESTLIBDIR)/ec/$(LP)ecere$(SO)
ln -sf ../$(LP)ecereCOM$(SOV) $(DESTLIBDIR)/ec/$(LP)ecereCOM$(SO)
ifdef EDASQLiteCipher
@@ -718,11 +883,12 @@ else
install $(INSTALL_FLAGS) $(OBJLIBDIR)$(LP)ecereCOM$(SO) $(DESTLIBDIR)/$(LP)ecereCOM$(SO)
endif
install $(INSTALL_FLAGS) $(OBJBINDIR)ecere-ide$(E) $(BINDIR)/ecere-ide$(E)
- install $(INSTALL_FLAGS) $(OBJBINDIR)ear$(E) $(BINDIR)/ear$(E)
- install $(INSTALL_FLAGS) $(OBJBINDIR)ecc$(E) $(BINDIR)/ecc$(E)
- install $(INSTALL_FLAGS) $(OBJBINDIR)ecp$(E) $(BINDIR)/ecp$(E)
- install $(INSTALL_FLAGS) $(OBJBINDIR)ecs$(E) $(BINDIR)/ecs$(E)
+ install $(INSTALL_FLAGS) $(OBJBINDIR)ear$(B32_SFX)$(E) $(BINDIR)/ear$(B32_SFX)$(E)
+ install $(INSTALL_FLAGS) $(OBJBINDIR)ecc$(B32_SFX)$(E) $(BINDIR)/ecc$(B32_SFX)$(E)
+ install $(INSTALL_FLAGS) $(OBJBINDIR)ecp$(B32_SFX)$(E) $(BINDIR)/ecp$(B32_SFX)$(E)
+ install $(INSTALL_FLAGS) $(OBJBINDIR)ecs$(B32_SFX)$(E) $(BINDIR)/ecs$(B32_SFX)$(E)
install $(INSTALL_FLAGS) $(OBJBINDIR)epj2make$(E) $(BINDIR)/epj2make$(E)
+ install $(INSTALL_FLAGS) $(OBJBINDIR)bgen$(E) $(BINDIR)/bgen$(E)
install $(INSTALL_FLAGS) $(OBJBINDIR)documentor$(E) $(BINDIR)/documentor$(E)
ifdef CodeGuard
install $(INSTALL_FLAGS) $(OBJBINDIR)CodeGuard$(E) $(BINDIR)/CodeGuard$(E)
@@ -758,10 +924,13 @@ ifdef DEBIAN_PACKAGE
cp $(DESTDIR)$(prefix)/share/doc/libecere0/changelog.gz $(DESTDIR)$(prefix)/share/doc/ecere-sdk/
mkdir -p $(DESTDIR)$(prefix)/share/doc/libecc0
ln -sf ../libecere0/changelog.gz $(DESTDIR)$(prefix)/share/doc/libecc0/
+ mkdir -p $(DESTDIR)$(prefix)/share/doc/libecc2
+ ln -sf ../libecere0/changelog.gz $(DESTDIR)$(prefix)/share/doc/libecc2/
mkdir -p $(DESTDIR)$(prefix)/share/doc/libecerecom0
cp $(DESTDIR)$(prefix)/share/doc/libecere0/changelog.gz $(DESTDIR)$(prefix)/share/doc/libecerecom0/
mkdir -p $(DESTDIR)$(prefix)/share/doc/libeda0
ln -sf ../libecere0/changelog.gz $(DESTDIR)$(prefix)/share/doc/libeda0/
+ # todo or not? add edadbase and edasqlitecipher?
mkdir -p $(DESTDIR)$(prefix)/share/doc/libedasqlite0
ln -sf ../libecere0/changelog.gz $(DESTDIR)$(prefix)/share/doc/libedasqlite0/
mkdir -p $(DESTDIR)$(prefix)/share/doc/libecereaudio0
@@ -774,9 +943,15 @@ uninstall:
$(call rm,"$(DESTLIBDIR)/$(LP)ecere$(SO)")
$(call rm,"$(DESTLIBDIR)/$(LP)ecereCOM$(SO)")
$(call rm,"$(DESTLIBDIR)/$(LP)ec$(SO)")
+ $(call rm,"$(DESTLIBDIR)/$(LP)ec2$(SO)")
$(call rm,"$(DESTLIBDIR)/$(LP)EDA$(SO)")
ifdef LINUX_TARGET
+ifdef EDAdBASE
+ $(call rm,"$(DESTLIBDIR)/ec/$(LP)EDAdBASE$(SO)")
+endif
+ifdef EDASQLite
$(call rm,"$(DESTLIBDIR)/ec/$(LP)EDASQLite$(SO)")
+endif
ifdef EDASQLiteCipher
$(call rm,"$(DESTLIBDIR)/ec/$(LP)EDASQLiteCipher$(SO)")
endif
@@ -784,7 +959,12 @@ ifneq ($(ECERE_AUDIO),n)
$(call rm,"$(DESTLIBDIR)/ec/$(LP)EcereAudio$(SO)")
endif
else
+ifdef EDAdBASE
+ $(call rm,"$(DESTLIBDIR)/$(LP)EDAdBASE$(SO)")
+endif
+ifdef EDASQLite
$(call rm,"$(DESTLIBDIR)/$(LP)EDASQLite$(SO)")
+endif
ifdef EDASQLiteCipher
$(call rm,"$(DESTLIBDIR)/$(LP)EDASQLiteCipher$(SO)")
endif
@@ -793,11 +973,12 @@ ifneq ($(ECERE_AUDIO),n)
endif
endif
$(call rm,"$(BINDIR)/ecere-ide$(E)")
- $(call rm,"$(BINDIR)/ear$(E)")
- $(call rm,"$(BINDIR)/ecc$(E)")
- $(call rm,"$(BINDIR)/ecp$(E)")
- $(call rm,"$(BINDIR)/ecs$(E)")
+ $(call rm,"$(BINDIR)/ear$(B32_SFX)$(E)")
+ $(call rm,"$(BINDIR)/ecc$(B32_SFX)$(E)")
+ $(call rm,"$(BINDIR)/ecp$(B32_SFX)$(E)")
+ $(call rm,"$(BINDIR)/ecs$(B32_SFX)$(E)")
$(call rm,"$(BINDIR)/epj2make$(E)")
+ $(call rm,"$(BINDIR)/bgen$(E)")
$(call rm,"$(BINDIR)/documentor$(E)")
ifdef CodeGuard
$(call rm,"$(BINDIR)/CodeGuard$(E)")
@@ -815,7 +996,12 @@ ifdef LINUX_TARGET
$(call rm,"$(DESTLIBDIR)/$(LP)ecereCOM$(SO).0")
$(call rm,"$(DESTLIBDIR)/ec/$(LP)ec$(SO).0")
$(call rm,"$(DESTLIBDIR)/ec/$(LP)EDA$(SO).0")
+ifdef EDAdBASE
+ $(call rm,"$(DESTLIBDIR)/ec/$(LP)EDAdBASE$(SO).0")
+endif
+ifdef EDASQLite
$(call rm,"$(DESTLIBDIR)/ec/$(LP)EDASQLite$(SO).0")
+endif
ifdef EDASQLiteCipher
$(call rm,"$(DESTLIBDIR)/ec/$(LP)EDASQLiteCipher$(SO).0")
endif
@@ -823,8 +1009,14 @@ endif
$(call rm,"$(DESTLIBDIR)/$(LP)ecere$(SOV)")
$(call rm,"$(DESTLIBDIR)/$(LP)ecereCOM$(SOV)")
$(call rm,"$(DESTLIBDIR)/ec/$(LP)ec$(SOV)")
+ $(call rm,"$(DESTLIBDIR)/ec/$(LP)ec2$(SOV)")
$(call rm,"$(DESTLIBDIR)/ec/$(LP)EDA$(SOV)")
+ifdef EDAdBASE
+ $(call rm,"$(DESTLIBDIR)/ec/$(LP)EDAdBASE$(SOV)")
+endif
+ifdef EDASQLite
$(call rm,"$(DESTLIBDIR)/ec/$(LP)EDASQLite$(SOV)")
+endif
ifdef EDASQLiteCipher
$(call rm,"$(DESTLIBDIR)/ec/$(LP)EDASQLiteCipher$(SOV)")
endif
@@ -930,3 +1122,5 @@ troubleshoot:
@$(call echo,OPENSSL_INCLUDE_DIR=$(OPENSSL_INCLUDE_DIR))
@$(call echo,OPENSSL_LIB_DIR=$(OPENSSL_LIB_DIR))
@$(call echo,OPENSSL_BIN_DIR=$(OPENSSL_BIN_DIR))
+ @$(call echo,ROOT_ABSPATH=$(ROOT_ABSPATH))
+ @$(call echo,DYLD_LIBRARY_PATH=$(DYLD_LIBRARY_PATH))
diff --git a/Makefile.bindings b/Makefile.bindings
new file mode 100644
index 0000000000..51ae4d3020
--- /dev/null
+++ b/Makefile.bindings
@@ -0,0 +1,405 @@
+ifneq ($(V),1)
+.SILENT:
+endif
+
+ifndef CROSSPLATFORM_MK
+include crossplatform.mk
+include default.cf
+endif
+
+renameEcereCOM = $(subst ecereCOM,eC,$(1))
+#$(call renameEcereCOM,$(word $(1),$(BGEN_LIBS))) $(call selectLib,$(1))
+selectLib = $(word $(1),$(BGEN_LIBS))
+
+ifndef BINDINGS_DIR
+BINDINGS_DIR := bindings
+endif
+ifndef C_BINDINGS_DIR
+C_BINDINGS_DIR := $(BINDINGS_DIR)/c
+endif
+ifndef CPP_BINDINGS_DIR
+CPP_BINDINGS_DIR := $(BINDINGS_DIR)/cpp
+endif
+ifndef PY_BINDINGS_DIR
+PY_BINDINGS_DIR := $(BINDINGS_DIR)/py
+endif
+
+ifndef BGEN_LIBS
+BGEN_LIBS := obj/linux/lib/$(LP)ecereCOM$(SO) obj/linux/lib/$(LP)ecere$(SO) obj/linux/lib/$(LP)EDA$(SO) $(ADDITIONAL_BGEN_LIBS)
+endif
+BGEN_ARGS := -fren Log=__e_log,Logf=__e_logf,Sleep=__sleep,Print=printx
+BGEN_QUIET := $(if $(SILENT_IS_ON),-quiet,)
+
+_BGEN_OUTS := $(foreach _lib,$(BGEN_LIBS),$(call renameEcereCOM,$(call lib_path_to_name,$(_lib))))
+_BGEN_C_OUTPUT := $(addsuffix .h,$(_BGEN_OUTS)) $(addsuffix .c,$(_BGEN_OUTS)) $(addsuffix _c.Makefile,$(_BGEN_OUTS))
+_BGEN_CPP_OUTPUT := $(addsuffix .h,$(_BGEN_OUTS)) $(addsuffix .c,$(_BGEN_OUTS)) $(addsuffix _cpp.Makefile,$(_BGEN_OUTS))
+_BGEN_PY_OUTPUT := $(addprefix cffi-,$(addsuffix .h,$(_BGEN_OUTS))) $(addsuffix .py,$(_BGEN_OUTS)) $(addprefix build_,$(addsuffix .py,$(_BGEN_OUTS)))
+
+# note: this is needed because we chdir without the use of a makefile specifying a different _CF_DIR
+# and cannot call bgen with the usual relative path specified by $(BGEN)
+# i.e.: +cd $(C_BINDINGS_DIR) && $(BGEN) $(BGEN_ARGS) $(BGEN_QUIET) -c $(BGEN_LIBS)
+#ROOT_ABSPATH = $(dir $(realpath $(firstword $(MAKEFILE_LIST))))
+#BGEN := $(call sys_path,$(ROOT_ABSPATH)$(_CF_DIR)obj/$(HOST_PLATFORM)$(COMPILER_SUFFIX)$(DEBUG_SUFFIX)/bin/bgen$(HOST_E))
+
+ifdef WINDOWS_HOST
+PYTHON := python
+else
+PYTHON := python3
+endif
+PY_VER := 3
+
+BG_LANG_c := C
+BG_LANG_cpp := C++
+BG_LANG_py := Python $(PY_VER)
+
+lib_path_to_name = $(basename $(if $(LP),$(patsubst $(LP)%$(SO),%$(SO),$(notdir $(1))),$(notdir $(1))))
+get_binding_name = $(call renameEcereCOM,$(call lib_path_to_name,$(call selectLib,$(1))))
+
+bg_src_file_c = $(call get_binding_name,$(1)).c
+bg_src_file_cpp = $(call get_binding_name,$(1)).cpp
+bg_src_file_py = $(call get_binding_name,$(1)).py
+
+bg_hdr_file_c = $(call get_binding_name,$(1)).h
+bg_hdr_file_cpp = $(call get_binding_name,$(1)).hpp
+bg_hdr_file_py =
+
+bg_mak_file_c = $(call get_binding_name,$(1))_c.Makefile
+bg_mak_file_cpp = $(call get_binding_name,$(1))_cpp.Makefile
+bg_mak_file_py = build_$(call get_binding_name,$(1)).py
+
+bg_file_path_c = $(C_BINDINGS_DIR)/$(call bg_$(3)_file_$(2),$(1))
+bg_file_path_cpp = $(CPP_BINDINGS_DIR)/$(call bg_$(3)_file_$(2),$(1))
+bg_file_path_py = $(PY_BINDINGS_DIR)/$(call bg_$(3)_file_$(2),$(1))
+
+bg_bld_cmd_c = $(_MAKE) -f $(call bg_mak_file_$(2),$(1)) $(3)
+bg_bld_cmd_cpp = $(_MAKE) -f $(call bg_mak_file_$(2),$(1)) $(3)
+bg_bld_cmd_py = $(PYTHON) $(call bg_mak_file_$(2),$(1))
+
+bg_print_lib_name = $(call echo,$(call get_binding_name,$(1)))
+
+bg_bind_____echo = $(call bg_bind_echo_,$(1),$(2))
+bg_bind_echo_ = $(if $(call selectLib,$(1)),$(if $(wildcard $(call bg_file_path_$(2),$(1),$(2),mak)),@$(call echo,Building $(BG_LANG_$(2)) bindings for $(call get_binding_name,$(1)) ($(call selectLib,$(1)))...),),)
+
+bg_bind_cd_build = $(if $(call selectLib,$(1)),$(if $(wildcard $(call bg_file_path_$(2),$(1),$(2),mak)),$(call _bg_bind_cd_build,$(1),$(2),$(3)),$(call echo,Error: $(call bg_file_path_$(2),$(1),$(2),mak) not found!)),)
+_bg_bind_cd_build = +cd $(BINDINGS_DIR)/$(2) && $(call bg_bld_cmd_$(2),$(1),$(2),$(3))
+# todo: make this an actual error?
+
+bg_bind_any_gened_exists = $(wildcard $(call bg_file_path_$(2),$(1),$(2),src))$(wildcard $(call bg_file_path_$(2),$(1),$(2),hdr))$(wildcard $(call bg_file_path_$(2),$(1),$(2),mak))
+bg_bind_rmr_gened = $(if $(call selectLib,$(1)),$(if $(2),$(if $(call bg_bind_any_gened_exists,$(1),$(2)),$(call rmr,$(call bg_file_path_$(2),$(1),$(2),src) $(call bg_file_path_$(2),$(1),$(2),hdr) $(call bg_file_path_$(2),$(1),$(2),mak)),),),)
+
+# All
+################################################################################################################################
+
+.PHONY: bgentalk
+bgentalk: bindings_build
+ @$(call echo,"")
+ @$(call echo, have a great day!)
+ @$(call echo, -bgen)
+
+.PHONY: list_bindings_name
+list_bindings_name:
+ $(call bg_print_lib_name,1)
+ $(call bg_print_lib_name,2)
+ $(call bg_print_lib_name,3)
+ $(call bg_print_lib_name,4)
+ $(call bg_print_lib_name,5)
+ $(call bg_print_lib_name,6)
+ $(call bg_print_lib_name,7)
+ $(call bg_print_lib_name,8)
+ $(call bg_print_lib_name,9)
+
+.PHONY: bindings
+.NOTPARALLEL: bindings
+bindings: bgentalk
+
+.PHONY: bindingsgen
+.NOTPARALLEL: bindingsgen
+bindingsgen: bindings_gen
+
+.PHONY: bindings_gen
+.NOTPARALLEL: bindings_gen
+bindings_gen: c_bindings_gen cpp_bindings_gen py_bindings_gen
+
+.PHONY: bindings_build
+.NOTPARALLEL: bindings_build
+bindings_build: c_bindings_build cpp_bindings_build py_bindings_build
+
+.PHONY: bindings_clean
+.NOTPARALLEL: bindings_clean
+bindings_clean: c_bindings_clean cpp_bindings_clean py_bindings_clean
+
+.PHONY: bindings_cleantarget
+.NOTPARALLEL: bindings_cleantarget
+bindings_cleantarget: c_bindings_cleantarget cpp_bindings_cleantarget py_bindings_cleantarget
+
+.PHONY: bindings_realclean
+.NOTPARALLEL: bindings_realclean
+bindings_realclean: c_bindings_realclean cpp_bindings_realclean py_bindings_realclean
+
+.PHONY: bindings_wipeclean
+.NOTPARALLEL: bindings_wipeclean
+bindings_wipeclean: c_bindings_wipeclean cpp_bindings_wipeclean py_bindings_wipeclean
+
+.PHONY: bindings_distclean
+.NOTPARALLEL: bindings_distclean
+bindings_distclean:
+ $(call rmr,$(BINDINGS_DIR)/)
+
+# C
+################################################################################################################################
+
+.PHONY: c_bindings
+.NOTPARALLEL: c_bindings
+c_bindings: c_bindings_build
+
+.PHONY: c_bindings_gen
+.NOTPARALLEL: c_bindings_gen
+c_bindings_gen: $(BINARIES)
+ @$(call echo,Generating C bindings...)
+ $(call mkdir,$(BINDINGS_DIR))
+ $(call mkdir,$(C_BINDINGS_DIR))
+ $(if $(BGEN_SKIP),,$(BGEN) -dir $(C_BINDINGS_DIR) $(BGEN_ARGS) $(BGEN_QUIET) -c $(BGEN_LIBS))
+
+.PHONY: c_bindings_build
+.NOTPARALLEL: c_bindings_build
+c_bindings_build: c_bindings_gen
+ $(call bg_bind_____echo,1,c)
+ $(call bg_bind_cd_build,1,c,all)
+ $(call bg_bind_____echo,2,c)
+ $(call bg_bind_cd_build,2,c,all)
+ $(call bg_bind_____echo,3,c)
+ $(call bg_bind_cd_build,3,c,all)
+ $(call bg_bind_____echo,4,c)
+ $(call bg_bind_cd_build,4,c,all)
+ $(call bg_bind_____echo,5,c)
+ $(call bg_bind_cd_build,5,c,all)
+ $(call bg_bind_____echo,6,c)
+ $(call bg_bind_cd_build,6,c,all)
+ $(call bg_bind_____echo,7,c)
+ $(call bg_bind_cd_build,7,c,all)
+ $(call bg_bind_____echo,8,c)
+ $(call bg_bind_cd_build,8,c,all)
+ $(call bg_bind_____echo,9,c)
+ $(call bg_bind_cd_build,9,c,all)
+
+.PHONY: c_bindings_install
+.NOTPARALLEL: c_bindings_install
+c_bindings_install:
+ install $(INSTALL_FLAGS) $(OBJLIBDIR)$(LP)ecere_c$(SOV) $(DESTLIBDIR)/$(LP)ecere_c$(SOV)
+ install $(INSTALL_FLAGS) $(OBJLIBDIR)$(LP)eC_c$(SOV) $(DESTLIBDIR)/$(LP)eC_c$(SOV)
+ install $(INSTALL_FLAGS) $(OBJLIBDIR)$(LP)EDA_c$(SOV) $(DESTLIBDIR)/ec/$(LP)EDA_c$(SOV)
+ ln -sf $(LP)ecere_c$(SOV) $(DESTLIBDIR)/$(LP)ecere_c$(SO).0
+ ln -sf $(LP)eC_c$(SOV) $(DESTLIBDIR)/$(LP)eC_c$(SO).0
+ ln -sf $(LP)EDA_c$(SOV) $(DESTLIBDIR)/ec/$(LP)EDA_c$(SO).0
+
+.PHONY: c_bindings_clean
+.NOTPARALLEL: c_bindings_clean
+c_bindings_clean:
+ $(call bg_bind_cd_build,1,c,clean)
+ $(call bg_bind_cd_build,2,c,clean)
+ $(call bg_bind_cd_build,3,c,clean)
+ $(call bg_bind_cd_build,4,c,clean)
+ $(call bg_bind_cd_build,5,c,clean)
+ $(call bg_bind_cd_build,6,c,clean)
+ $(call bg_bind_cd_build,7,c,clean)
+ $(call bg_bind_cd_build,8,c,clean)
+ $(call bg_bind_cd_build,9,c,clean)
+ $(call rmr,$(_BGEN_C_OUTPUT))
+
+.PHONY: c_bindings_cleantarget
+.NOTPARALLEL: c_bindings_cleantarget
+c_bindings_cleantarget:
+ $(call bg_bind_cd_build,1,c,cleantarget)
+ $(call bg_bind_cd_build,2,c,cleantarget)
+ $(call bg_bind_cd_build,3,c,cleantarget)
+ $(call bg_bind_cd_build,4,c,cleantarget)
+ $(call bg_bind_cd_build,5,c,cleantarget)
+ $(call bg_bind_cd_build,6,c,cleantarget)
+ $(call bg_bind_cd_build,7,c,cleantarget)
+ $(call bg_bind_cd_build,8,c,cleantarget)
+ $(call bg_bind_cd_build,9,c,cleantarget)
+
+.PHONY: c_bindings_realclean
+.NOTPARALLEL: c_bindings_realclean
+c_bindings_realclean:
+ $(call rmr,$(C_BINDINGS_DIR)/obj)
+ $(call bg_bind_rmr_gened,1,c)
+ $(call bg_bind_rmr_gened,2,c)
+ $(call bg_bind_rmr_gened,3,c)
+ $(call bg_bind_rmr_gened,4,c)
+ $(call bg_bind_rmr_gened,5,c)
+ $(call bg_bind_rmr_gened,6,c)
+ $(call bg_bind_rmr_gened,7,c)
+ $(call bg_bind_rmr_gened,8,c)
+ $(call bg_bind_rmr_gened,9,c)
+
+.PHONY: c_bindings_wipeclean
+c_bindings_wipeclean:
+ $(call rmr,$(C_BINDINGS_DIR))
+ $(call bg_bind_rmr_gened,1,c)
+ $(call bg_bind_rmr_gened,2,c)
+ $(call bg_bind_rmr_gened,3,c)
+ $(call bg_bind_rmr_gened,4,c)
+ $(call bg_bind_rmr_gened,5,c)
+ $(call bg_bind_rmr_gened,6,c)
+ $(call bg_bind_rmr_gened,7,c)
+ $(call bg_bind_rmr_gened,8,c)
+ $(call bg_bind_rmr_gened,9,c)
+
+# C++
+################################################################################################################################
+
+.PHONY: cpp_bindings
+.NOTPARALLEL: cpp_bindings
+cpp_bindings: cpp_bindings_build
+
+.PHONY: cpp_bindings_gen
+.NOTPARALLEL: cpp_bindings_gen
+cpp_bindings_gen: $(BINARIES)
+ @$(call echo,Generating C++ bindings...)
+ $(call mkdir,$(BINDINGS_DIR))
+ $(call mkdir,$(CPP_BINDINGS_DIR))
+ $(if $(BGEN_SKIP),,$(BGEN) -dir $(CPP_BINDINGS_DIR) $(BGEN_ARGS) $(BGEN_QUIET) -cpp -bypassmacros $(BGEN_LIBS))
+
+.PHONY: cpp_bindings_build
+.NOTPARALLEL: cpp_bindings_build
+cpp_bindings_build: cpp_bindings_gen
+ $(call bg_bind_____echo,1,cpp)
+ $(call bg_bind_cd_build,1,cpp,all)
+ $(call bg_bind_____echo,2,cpp)
+ $(call bg_bind_cd_build,2,cpp,all)
+ $(call bg_bind_____echo,3,cpp)
+ $(call bg_bind_cd_build,3,cpp,all)
+ $(call bg_bind_____echo,4,cpp)
+ $(call bg_bind_cd_build,4,cpp,all)
+ $(call bg_bind_____echo,5,cpp)
+ $(call bg_bind_cd_build,5,cpp,all)
+ $(call bg_bind_____echo,6,cpp)
+ $(call bg_bind_cd_build,6,cpp,all)
+ $(call bg_bind_____echo,7,cpp)
+ $(call bg_bind_cd_build,7,cpp,all)
+ $(call bg_bind_____echo,8,cpp)
+ $(call bg_bind_cd_build,8,cpp,all)
+ $(call bg_bind_____echo,9,cpp)
+ $(call bg_bind_cd_build,9,cpp,all)
+
+.PHONY: cpp_bindings_clean
+.NOTPARALLEL: cpp_bindings_clean
+cpp_bindings_clean:
+ $(call bg_bind_cd_build,1,cpp,clean)
+ $(call bg_bind_cd_build,2,cpp,clean)
+ $(call bg_bind_cd_build,3,cpp,clean)
+ $(call bg_bind_cd_build,4,cpp,clean)
+ $(call bg_bind_cd_build,5,cpp,clean)
+ $(call bg_bind_cd_build,6,cpp,clean)
+ $(call bg_bind_cd_build,7,cpp,clean)
+ $(call bg_bind_cd_build,8,cpp,clean)
+ $(call bg_bind_cd_build,9,cpp,clean)
+ $(call rmr,$(_BGEN_CPP_OUTPUT))
+
+.PHONY: cpp_bindings_cleantarget
+.NOTPARALLEL: cpp_bindings_cleantarget
+cpp_bindings_cleantarget:
+ $(call bg_bind_cd_build,1,cpp,cleantarget)
+ $(call bg_bind_cd_build,2,cpp,cleantarget)
+ $(call bg_bind_cd_build,3,cpp,cleantarget)
+ $(call bg_bind_cd_build,4,cpp,cleantarget)
+ $(call bg_bind_cd_build,5,cpp,cleantarget)
+ $(call bg_bind_cd_build,6,cpp,cleantarget)
+ $(call bg_bind_cd_build,7,cpp,cleantarget)
+ $(call bg_bind_cd_build,8,cpp,cleantarget)
+ $(call bg_bind_cd_build,9,cpp,cleantarget)
+
+.PHONY: cpp_bindings_realclean
+.NOTPARALLEL: cpp_bindings_realclean
+cpp_bindings_realclean:
+ $(call rmr,$(CPP_BINDINGS_DIR)/obj)
+ $(call bg_bind_rmr_gened,1,cpp)
+ $(call bg_bind_rmr_gened,2,cpp)
+ $(call bg_bind_rmr_gened,3,cpp)
+ $(call bg_bind_rmr_gened,4,cpp)
+ $(call bg_bind_rmr_gened,5,cpp)
+ $(call bg_bind_rmr_gened,6,cpp)
+ $(call bg_bind_rmr_gened,7,cpp)
+ $(call bg_bind_rmr_gened,8,cpp)
+ $(call bg_bind_rmr_gened,9,cpp)
+
+.PHONY: cpp_bindings_wipeclean
+.NOTPARALLEL: cpp_bindings_wipeclean
+cpp_bindings_wipeclean:
+ $(call rmr,$(CPP_BINDINGS_DIR))
+ $(call bg_bind_rmr_gened,1,cpp)
+ $(call bg_bind_rmr_gened,2,cpp)
+ $(call bg_bind_rmr_gened,3,cpp)
+ $(call bg_bind_rmr_gened,4,cpp)
+ $(call bg_bind_rmr_gened,5,cpp)
+ $(call bg_bind_rmr_gened,6,cpp)
+ $(call bg_bind_rmr_gened,7,cpp)
+ $(call bg_bind_rmr_gened,8,cpp)
+ $(call bg_bind_rmr_gened,9,cpp)
+
+# Python
+################################################################################################################################
+
+.PHONY: py_bindings
+.NOTPARALLEL: py_bindings
+py_bindings: py_bindings_build
+
+.PHONY: py_bindings_gen
+.NOTPARALLEL: py_bindings_gen
+py_bindings_gen: $(BINARIES)
+ @$(call echo,Generating Python bindings...)
+ $(call mkdir,$(BINDINGS_DIR))
+ $(call mkdir,$(PY_BINDINGS_DIR))
+ $(if $(BGEN_SKIP),,$(BGEN) -dir $(PY_BINDINGS_DIR) $(BGEN_ARGS) $(BGEN_QUIET) -py $(BGEN_LIBS))
+
+OBJLIBDIR := $(OBJDIR)$(PLATFORM)$(COMPILER_SUFFIX)$(DEBUG_SUFFIX)/lib/
+
+.PHONY: py_bindings_build
+.NOTPARALLEL: py_bindings_build
+py_bindings_build: c_bindings_build py_bindings_gen
+ $(if $(wildcard $(ADDITIONAL_BGEN_LIBS)),$(call cp,$(wildcard $(ADDITIONAL_BGEN_LIBS)),$(OBJLIBDIR)),)
+ifdef PY_NA
+ $(error Using $(PYTHON) failed. Please set PYTHON to point to a valid python program name or location)
+else
+ $(call bg_bind_____echo,1,py)
+ $(call bg_bind_cd_build,1,py)
+ $(call bg_bind_____echo,2,py)
+ $(call bg_bind_cd_build,2,py)
+ $(call bg_bind_____echo,3,py)
+ $(call bg_bind_cd_build,3,py)
+ $(call bg_bind_____echo,4,py)
+ $(call bg_bind_cd_build,4,py)
+ $(call bg_bind_____echo,5,py)
+ $(call bg_bind_cd_build,5,py)
+ $(call bg_bind_____echo,6,py)
+ $(call bg_bind_cd_build,6,py)
+ $(call bg_bind_____echo,7,py)
+ $(call bg_bind_cd_build,7,py)
+ $(call bg_bind_____echo,8,py)
+ $(call bg_bind_cd_build,8,py)
+ $(call bg_bind_____echo,9,py)
+ $(call bg_bind_cd_build,9,py)
+endif
+
+.PHONY: py_bindings_clean
+.NOTPARALLEL: py_bindings_clean
+py_bindings_clean:
+ $(call rmr,$(_BGEN_PY_OUTPUT))
+
+.PHONY: py_bindings_cleantarget
+.NOTPARALLEL: py_bindings_cleantarget
+py_bindings_cleantarget:
+# @$(call echo,todo: py_bindings_cleantarget)
+
+.PHONY: py_bindings_realclean
+.NOTPARALLEL: py_bindings_realclean
+py_bindings_realclean:
+ $(call rmr,$(PY_BINDINGS_DIR)/obj)
+ $(call rmr,$(PY_BINDINGS_DIR)/__pycache__)
+# @$(call echo,todo: py_bindings_realclean -- _py*.c _py*.pyd)
+
+.PHONY: py_bindings_wipeclean
+.NOTPARALLEL: py_bindings_wipeclean
+py_bindings_wipeclean:
+ $(call rmr,$(PY_BINDINGS_DIR))
diff --git a/README.md b/README.md
index 38619071da..be3492a498 100644
--- a/README.md
+++ b/README.md
@@ -1,5 +1,5 @@
[](https://github.com/ecere/ecere-sdk/releases/latest)
-[](https://travis-ci.org/ecere/ecere-sdk)
+[](https://travis-ci.org/ecere/ecere-sdk)
[](http://ecere.org/overview)
[](https://github.com/ecere/ecere-sdk/graphs/traffic)
[-blue.svg)](https://tldrlegal.com/license/bsd-3-clause-license-(revised))
@@ -7,7 +7,7 @@
[](http://ec-lang.org)
[](http://ecere.org/forums)
[](http://ecere.org/mantis)
-[](http://webchat.freenode.net/?channels=ecere)
+[](https://web.libera.chat/?theme=cli#ecere)
[](http://www.meetup.com/eC-Programming-Language-Meetup)
# Ecere SDK
@@ -109,4 +109,4 @@ descriptive info has been added yet.
[Git Repository](http://github.com/ecere/ecere-sdk) ( git://github.com/ecere/ecere-sdk.git )
[Support forums](http://ecere.org/forums)
[Bug tracker](http://ecere.org/mantis)
-[IRC](http://webchat.freenode.net/?channels=ecere) - **#ecere** on irc.freenode.net
+[IRC](https://web.libera.chat/?theme=cli#ecere) - **#ecere** on irc.libera.chat
diff --git a/audio/Makefile b/audio/Makefile
index 73ecae5372..adb8fe6693 100644
--- a/audio/Makefile
+++ b/audio/Makefile
@@ -1,4 +1,8 @@
-.PHONY: all objdir cleantarget clean realclean distclean
+ifneq ($(V),1)
+.SILENT:
+endif
+
+.PHONY: all objdir cleantarget clean realclean wipeclean distclean
# CORE VARIABLES
@@ -129,7 +133,7 @@ endif
all: objdir $(TARGET)
objdir:
- $(if $(wildcard $(OBJ)),,$(call mkdir,$(OBJ)))
+ $(call mkdir,$(OBJ))
$(if $(ECERE_SDK_SRC),$(if $(wildcard $(call escspace,$(ECERE_SDK_SRC)/crossplatform.mk)),,@$(call echo,Ecere SDK Source Warning: The value of ECERE_SDK_SRC is pointing to an incorrect ($(ECERE_SDK_SRC)) location.)),)
$(if $(ECERE_SDK_SRC),,$(if $(ECP_DEBUG)$(ECC_DEBUG)$(ECS_DEBUG),@$(call echo,ECC Debug Warning: Please define ECERE_SDK_SRC before using ECP_DEBUG, ECC_DEBUG or ECS_DEBUG),))
@@ -213,7 +217,7 @@ $(OBJ)mixer.o: $(OBJ)mixer.c
$(OBJ)$(MODULE).main$(O): $(OBJ)$(MODULE).main.c
$(CC) $(CFLAGS) $(PRJ_CFLAGS) $(FVISIBILITY) -c $(OBJ)$(MODULE).main.c -o $(call quote_path,$@)
-cleantarget: objdir
+cleantarget:
$(call rm,$(OBJ)$(MODULE).main.o $(OBJ)$(MODULE).main.c $(OBJ)$(MODULE).main.ec $(OBJ)$(MODULE).main$(I) $(OBJ)$(MODULE).main$(S))
$(call rm,$(OBJ)symbols.lst)
$(call rm,$(OBJ)objects.lst)
@@ -238,9 +242,12 @@ clean: cleantarget
realclean: cleantarget
$(call rmr,$(OBJ))
+wipeclean:
+ $(call rmr,obj/)
+
distclean:
$(_MAKE) -f $(_CF_DIR)Cleanfile distclean distclean_all_subdirs
-Makefile: ;
-$(_CF_DIR)crossplatform.mk: ;
-$(_CF_DIR)default.cf: ;
+$(MAKEFILE_LIST): ;
+$(SOURCES): ;
+$(RESOURCES): ;
diff --git a/audio/alsa.ec b/audio/alsa.ec
index 8305a85807..66adbe58b8 100644
--- a/audio/alsa.ec
+++ b/audio/alsa.ec
@@ -22,13 +22,13 @@ public void AudioSetBalance(double percent)
{
balance = percent;
}
-
+ // TODO: Clarify the range of percent, Acovel invokes this with 0..1 slider values
public bool AudioSetVolume(VolumeControl type, double percent)
{
bool result = false;
if(type == application)
{
- volume = percent;
+ volume = percent * 100;
result = true;
}
else
diff --git a/autoLayout/SlideTest.epj b/autoLayout/SlideTest.epj
new file mode 100644
index 0000000000..d45452685b
--- /dev/null
+++ b/autoLayout/SlideTest.epj
@@ -0,0 +1,71 @@
+{
+ "Version" : 0.2,
+ "ModuleName" : "SlideTest",
+ "Options" : {
+ "Warnings" : "All",
+ "PreprocessorDefinitions" : [
+ "IMPORT_STATIC=\"\""
+ ],
+ "TargetType" : "Executable",
+ "TargetFileName" : "SlideTest",
+ "Libraries" : [
+ "ecere"
+ ]
+ },
+ "Configurations" : [
+ {
+ "Name" : "Debug",
+ "Options" : {
+ "Debug" : true,
+ "Optimization" : "None",
+ "PreprocessorDefinitions" : [
+ "_DEBUG"
+ ],
+ "Console" : true,
+ "FastMath" : false
+ }
+ },
+ {
+ "Name" : "Release",
+ "Options" : {
+ "Debug" : false,
+ "Optimization" : "Speed",
+ "FastMath" : true
+ }
+ }
+ ],
+ "Files" : [
+ {
+ "Folder" : "autoLayout",
+ "Files" : [
+ "autoLayout.ec",
+ "wrapText.ec"
+ ]
+ },
+ {
+ "Folder" : "graphics",
+ "Files" : [
+ "bg1.png"
+ ]
+ },
+ {
+ "Folder" : "slides",
+ "Files" : [
+ "slide1.ec",
+ "./base.ec",
+ "titleSlide.ec",
+ "languageSlide.ec",
+ "classesSlide.ec",
+ "instancesSlide.ec",
+ "formSlide.ec",
+ "buttonSlide.ec",
+ "gnosisSlide.ec"
+ ]
+ },
+ "slides.ec"
+ ],
+ "ResourcesPath" : "",
+ "Resources" : [
+
+ ]
+}
diff --git a/autoLayout/autoLayout/autoLayout.ec b/autoLayout/autoLayout/autoLayout.ec
new file mode 100644
index 0000000000..c9824bcac9
--- /dev/null
+++ b/autoLayout/autoLayout/autoLayout.ec
@@ -0,0 +1,561 @@
+public import "ecere"
+import "wrapText"
+
+// Add 'unset' ?
+enum UnitType { percent, pixels, points };
+
+struct Dimension
+{
+ UnitType type;
+ union { double d; int i; };
+ property double { set { d = value; type = percent; } get { return 0; } /* TODO: Compute this? Avoid use? */ }
+ property int { set { i = value; type = pixels; } get { return 0; } /* TODO: Compute this? Avoid use? */ }
+ int getPixels(int p) { return (type == pixels) ? i : (int)(d * p + 0.5); }
+};
+
+struct DimensionBox { Dimension left, top, right, bottom; };
+
+struct Dimensions { Dimension w, h; };
+
+enum Direction { horizontal, vertical };
+
+enum HVAlignment : Alignment { bottom = right, top = left };
+enum SelfAlignment : HVAlignment { inherit };
+
+FontResource defaultFont { "Tahoma", 8.25f };
+
+class Element
+{
+private:
+ List nodes;
+ DimensionBox margin;
+ DimensionBox border;
+ DimensionBox padding;
+ Size contentSize; // Computed from the content (Max of Text/Primitives extent and Children minimum extent)
+ Element parent;
+
+ Dimensions minSize, maxSize; // Size specification
+ Size clientSize;
+ BorderStyle borderStyle;
+ Point scroll;
+ bool hScroll, vScroll;
+ const String caption;
+ ColorAlpha bgColor;
+ ColorAlpha fgColor;
+ ColorAlpha borderColor;
+ Direction direction;
+ bool autoLayoutFlag;
+ Point position; // Position relative to parent's client area, including margin offset
+ Point tlPosition;
+ HVAlignment hAlignment, vAlignment; // Alignment of content (children or graphics) ?
+ SelfAlignment selfHAlignment, selfVAlignment;
+
+ selfHAlignment = inherit;
+ selfVAlignment = inherit;
+
+ autoLayoutFlag = true;
+ fgColor = black;
+ bgColor = 0;
+
+ FontResource font;
+ Font fontObject;
+ BitmapResource bitmap;
+ Bitmap bmpObject;
+ ColorAlpha bitmapTint;
+ bitmapTint = white;
+ /*
+ List primitives; // Displays above nodes
+ List bgPrimitives; // Displays behind nodes, need to figure out how to scale to width (e.g. Rectangle with a gradient)
+ List effects;
+ */
+
+ void loadGraphics(DisplaySystem displaySystem)
+ {
+ if(!fontObject)
+ {
+ Element e = this;
+ FontResource font;
+ while(e && !e.font) e = e.parent;
+ font = e ? e.font : defaultFont;
+ displaySystem.LoadResource(font);
+ fontObject = font.font;
+ }
+
+ if(!bmpObject && bitmap)
+ {
+ displaySystem.LoadResource(bitmap);
+ bmpObject = bitmap.bitmap;
+ }
+
+ for(n : nodes)
+ n.loadGraphics(displaySystem);
+ }
+
+ void computeContentSize(DisplaySystem displaySystem)
+ {
+ int cw = clientSize.w, ch = clientSize.h;
+ int minimum = 0, thickness = 0;
+ Size graphicsSize { };
+ int rcw = cw, rch = ch;
+ for(n : nodes)
+ {
+ Element e = n;
+ if(e.autoLayoutFlag)
+ {
+ int xw = e.maxSize.w.getPixels(cw);
+ int xh = e.maxSize.h.getPixels(ch);
+ int nw = e.minSize.w.getPixels(cw);
+ int nh = e.minSize.h.getPixels(ch);
+ int w = 0, h = 0;
+ Box m
+ {
+ left = e.margin.left.getPixels(cw);
+ right = e.margin.right.getPixels(cw);
+ top = e.margin.top.getPixels(ch);
+ bottom = e.margin.bottom.getPixels(ch);
+ };
+
+ xw += m.left = m.right;
+ xh += m.top = m.bottom;
+ nw += m.left = m.right;
+ nh += m.top = m.bottom;
+
+ if(xw > w)
+ w = Min(xw, rcw);
+ //if(xh > h)
+ h = Min(xh, rch);
+
+ if(xw && xw < w) w = xw;
+ if(xh && xh < h) h = xh;
+ if(nw && nw > w) w = nw;
+ if(nh && nh > h) h = nh;
+
+ if(!w) w = cw;
+ if(!h) h = ch;
+
+ w -= m.left + m.right;
+ h -= m.top + m.bottom;
+
+ e.clientSize = { w, h };
+
+ e.computeContentSize(displaySystem);
+ if(!e.hScroll && e.contentSize.w > nw) nw = e.contentSize.w;
+ if(!e.vScroll && e.contentSize.h > nh) nh = e.contentSize.h;
+
+ if(direction == horizontal)
+ rcw -= nw;
+
+ if(direction == horizontal)
+ {
+ minimum += nw;
+ if(nh > thickness) thickness = nh;
+ }
+ else
+ {
+ minimum += nh;
+ if(nw > thickness) thickness = nw;
+ }
+ }
+ }
+ if(caption)
+ {
+ /*if(!cw) cw = MAXINT;
+ if(!ch) ch = MAXINT;*/
+
+ //displaySystem.FontExtent(fontObject, caption, strlen(caption), (int *)&graphicsSize.w, (int *)&graphicsSize.h);
+ wrapTextExtent(displaySystem, fontObject, caption, cw, ch, (int *)&graphicsSize.w, (int *)&graphicsSize.h);
+ if(graphicsSize.w)
+ graphicsSize.w += 1;
+ }
+
+ // Set the content size to the max of (minimum extent of children, graphics extent)
+ if(direction == horizontal)
+ contentSize = { Max(graphicsSize.w, minimum), Max(graphicsSize.h, thickness) };
+ else
+ contentSize = { Max(graphicsSize.w, thickness), Max(graphicsSize.h, minimum) };
+ }
+
+ void updateTLPosition()
+ {
+ for(n : nodes)
+ {
+ Element e = n;
+ e.tlPosition = { e.position.x + tlPosition.x, e.position.y + tlPosition.y };
+ n.updateTLPosition();
+ }
+ }
+
+ void autoLayout()
+ {
+ int cw = clientSize.w, ch = clientSize.h;
+ int totalMax = 0;
+ int totalUsed[Alignment] = { 0 };
+ int thickness = direction == vertical ? clientSize.w : clientSize.h;
+ int start = 0;
+ SelfAlignment lastAlignment = (direction == horizontal) ? nodes[0].selfHAlignment : nodes[0].selfVAlignment;
+ int totalMin = 0;
+ if(lastAlignment == inherit) lastAlignment = (direction == horizontal) ? hAlignment : vAlignment;
+
+ // Allocate extra space
+ for(n : nodes)
+ {
+ Element e = n;
+ e.clientSize = { };
+ if(e.autoLayoutFlag)
+ {
+ Box m
+ {
+ left = e.margin.left.getPixels(cw);
+ right = e.margin.right.getPixels(cw);
+ top = e.margin.top.getPixels(ch);
+ bottom = e.margin.bottom.getPixels(ch);
+ };
+
+ if(direction == horizontal)
+ {
+ int xw = e.maxSize.w.getPixels(cw);
+ int nw = e.minSize.w.getPixels(cw);
+ int w = Max(nw, e.contentSize.w);
+ int mm = m.left + m.right;
+ if(xw && xw < w) w = xw;
+
+ totalMin += w + mm;
+
+ if(xw && w > xw) xw = w;
+
+ totalMax += Max(w, xw) + mm;
+ totalUsed[e.selfHAlignment == inherit ? hAlignment : e.selfHAlignment] += Max(xw, w) + mm;
+ }
+ else
+ {
+ int xh = e.maxSize.h.getPixels(ch);
+ int nh = e.minSize.h.getPixels(ch);
+ int h = Max(nh, e.contentSize.h);
+ int mm = m.top + m.bottom;
+ if(xh && xh < h) h = xh;
+
+ totalMin += h + mm;
+
+ if(xh && h > xh) xh = h;
+
+ totalMax += Max(h, xh) + mm;
+ totalUsed[e.selfVAlignment == inherit ? vAlignment : e.selfVAlignment] += Max(xh, h) + mm;
+ }
+ }
+ }
+
+ if(direction == horizontal)
+ {
+ if(totalUsed[lastAlignment] < cw)
+ {
+ if(lastAlignment == right)
+ start = (cw - totalUsed[lastAlignment]);
+ else if(lastAlignment == center)
+ start = (cw - totalUsed[lastAlignment]) / 2;
+ }
+ }
+ else
+ {
+ if(totalUsed[lastAlignment] < ch)
+ {
+ if(lastAlignment == right)
+ start = (ch - totalUsed[lastAlignment]);
+ else if(lastAlignment == center)
+ start = (ch - totalUsed[lastAlignment]) / 2;
+ }
+ }
+
+ for(n : nodes)
+ {
+ Element e = n;
+ int w = e.hScroll ? 0 : e.contentSize.w;
+ int h = e.vScroll ? 0 : e.contentSize.h;
+ int nw = e.minSize.w.getPixels(cw);
+ int nh = e.minSize.h.getPixels(ch);
+ int xw = e.maxSize.w.getPixels(cw);
+ int xh = e.maxSize.h.getPixels(ch);
+ Box m
+ {
+ left = e.margin.left.getPixels(cw);
+ right = e.margin.right.getPixels(cw);
+ top = e.margin.top.getPixels(ch);
+ bottom = e.margin.bottom.getPixels(ch);
+ };
+ bool positionUpdated = false;
+
+ if(nw > w) w = nw;
+ if(nh > h) h = nh;
+
+ w += m.left + m.right;
+ h += m.top + m.bottom;
+ xw += m.left + m.right;
+ xh += m.top + m.bottom;
+
+ if(xw && w > xw) w = xw;
+ if(xh && h > xh) h = xh;
+
+ if(direction == horizontal)
+ {
+ SelfAlignment alignment = e.selfHAlignment == inherit ? hAlignment : e.selfHAlignment;
+ int y = 0;
+ xw = (w < xw && totalMax > totalMin && cw > totalMin) ? (int)(w + (xw - w) * Min(1.0f, (float)(cw - totalMin) / (totalMax - totalMin))) : 0;
+
+ if(xw > w) w = xw;
+ if(xh > h) h = xh;
+ if(h > thickness) h = thickness;
+
+ w = Min(w, Max(0, cw - start));
+
+ if(alignment != lastAlignment && totalUsed[alignment] < cw && lastAlignment != right && (lastAlignment != center || alignment == right))
+ {
+ int newStart = (cw - totalUsed[alignment]);
+ if(alignment == center)
+ newStart /= 2;
+ if(newStart > start)
+ start = newStart;
+ lastAlignment = alignment;
+ }
+
+ switch(e.selfVAlignment == inherit ? vAlignment : e.selfVAlignment)
+ {
+ case right: y = thickness - h; break;
+ case center: y = (thickness - h) / 2; break;
+ }
+ e.position = { start, y + m.top };
+ start += w;
+ }
+ else
+ {
+ SelfAlignment alignment = e.selfVAlignment == inherit ? vAlignment : e.selfVAlignment;
+ int x = 0;
+ xh = (h < xh && totalMax > totalMin && ch > totalMin) ? (int)(h + (xh - h) * Min(1.0f, (float)(ch - totalMin) / (totalMax - totalMin))) : 0;
+
+ if(xh > h) h = xh;
+ if(xw > w) w = xw;
+ if(w > thickness) w = thickness;
+
+ h = Min(h, Max(0, ch - start));
+
+ if(alignment != lastAlignment && totalUsed[alignment] < ch && lastAlignment != right && (lastAlignment != center || alignment == right))
+ {
+ int newStart = (ch - totalUsed[alignment]);
+ if(alignment == center)
+ newStart /= 2;
+ if(newStart > start)
+ start = newStart;
+ lastAlignment = alignment;
+ }
+
+ switch(e.selfHAlignment == inherit ? hAlignment : e.selfHAlignment)
+ {
+ case right: x = thickness - w; break;
+ case center: x = (thickness - w) / 2; break;
+ }
+
+ e.position = { x + m.left, start };
+ start += h;
+ }
+ w -= m.left + m.right;
+ h -= m.top + m.bottom;
+
+ if(w != e.clientSize.w || h != e.clientSize.h)
+ {
+ e.tlPosition = { e.position.x + tlPosition.x, e.position.y + tlPosition.y };
+ e.clientSize = { w, h };
+ if(e.autoLayoutFlag && e.nodes)
+ e.autoLayout();
+ }
+ else
+ {
+ if(e.tlPosition.x != e.position.x + tlPosition.x || e.tlPosition.y != e.position.y + tlPosition.y )
+ positionUpdated = true;
+ e.tlPosition = { e.position.x + tlPosition.x, e.position.y + tlPosition.y };
+ if(positionUpdated && e.nodes)
+ e.updateTLPosition();
+ }
+ }
+ }
+
+ void render(Surface surface)
+ {
+ surface.background = bgColor;
+ surface.Area(tlPosition.x, tlPosition.y, tlPosition.x + clientSize.w - 1, tlPosition.y + clientSize.h - 1);
+ if(bmpObject)
+ {
+ int sw = bmpObject.width, sh = bmpObject.height;
+ int x = (clientSize.w - sw) / 2;
+ int y = (clientSize.h - sh) / 2;
+ surface.blitTint = bitmapTint;
+ surface.Blit(bmpObject, x,y,0,0, sw,sh);
+ }
+ if(caption)
+ {
+ int sw = contentSize.w, sh = contentSize.h;
+ int x = tlPosition.x, y = tlPosition.y;
+ if(hAlignment == center)
+ x += (clientSize.w - sw) / 2;
+ if(vAlignment == center)
+ y += (clientSize.h - sh) / 2;
+
+ surface.foreground = fgColor;
+ surface.font = fontObject;
+ // surface.WriteText(x, y, caption, strlen(caption));
+ wrapText(surface, caption, x, y, tlPosition.x + clientSize.w, tlPosition.y + clientSize.h);
+ }
+ if(nodes)
+ {
+ for(n : nodes)
+ n.render(surface);
+ }
+ }
+
+public:
+ property Element parent
+ {
+ set
+ {
+ if(!value.nodes) value.nodes = { };
+ value.nodes.Add(this);
+
+ parent = value;
+ }
+ }
+}
+
+/*
+class Elemental : Col
+{
+ Bar r1
+ {
+ Element b0 { caption = "<<" };
+ Bar s1 { };
+ Element b1 { caption = "The" };
+ Element b2 { caption = "Quick" };
+ Element b3 { caption = "Brown" };
+ Bar s2 { };
+ };
+ Bar r2
+ {
+ Element b4 { caption = "Fox." };
+ Element b5 { };
+ Element b6 { };
+ };
+ Bar r3
+ {
+ Element b7 { caption = "Left" };
+ Element b8 { caption = "Address Bar" };
+ Element b9 { caption = "Right" };
+ };
+}
+
+{ [
+ { "class == Elemental", bgColor = ivory },
+ { "id == Elemental::r1", bgColor = gray, maxSize = { 100%, 100 } },
+ { "id == Elemental::b0", fgColor = white, bgColor = navy },
+ { "id == Elemental::b1", bgColor = red },
+ { "id == Elemental::b2", bgColor = blue, fgColor = white },
+
+ { "id == Elemental::r2", bgColor = lightGray, maxSize = { 100%, 150 } },
+ { "id == Elemental::b4", bgColor = yellow },
+ { "id == Elemental::b5", bgColor = aquamarine, maxSize = { 25%, 50 } },
+ { "id == Elemental::b6", bgColor = tomato, maxSize = { 50%, 50 } },
+
+ { "id == Elemental::r3", bgColor = lightGray, maxSize = { 100%, 0 } },
+ { "id == Elemental::b7", bgColor = skyBlue },
+ { "id == Elemental::b8", bgColor = teal, maxSize.w = 100% },
+ { "id == Elemental::b9", bgColor = maroon }
+] };
+*/
+
+class Bar : Element
+{
+ direction = horizontal;
+ maxSize = { 1.0, 1.0 };
+}
+
+class Col : Element
+{
+ direction = vertical;
+ maxSize = { 1.0, 1.0 };
+}
+
+/*
+class Elemental : Col
+{
+ bgColor = ivory;
+
+ Bar header { this, bgColor = blue };
+ Bar middle { this, bgColor = white };
+ Col col1 { middle, bgColor = lime };
+ Element e1 { col1, caption = "Foo", bgColor = gray, selfHAlignment = center, selfVAlignment = center };
+ Col col2 { middle, bgColor = skyBlue };
+ Element e2 { col2, caption = "Bar", bgColor = lightGray, selfHAlignment = center, selfVAlignment = center };
+ Col col3 { middle, bgColor = tomato };
+ Element e3 { col3, caption = "Third", bgColor = lightGray, selfHAlignment = center, selfVAlignment = center };
+ Bar footer { this, bgColor = red };
+}
+
+class Elemental2 : Col
+{
+ bgColor = skyBlue;
+
+ Bar r1 { this };
+ Col c1 { r1, maxSize.w = 0.25, bgColor = blue };
+ Col c2 { r1, maxSize.w = 0.5, bgColor = red };
+ Col c3 { r1, maxSize.w = 0.25, bgColor = blue };
+
+ Bar r { this, bgColor = beige, maxSize.h = 10 };
+
+ Bar r2 { this };
+ Col d1 { r2, maxSize.w = 0.25, bgColor = blue };
+ Col d11 { r2, maxSize.w = 0.5, caption = "Hello", bgColor = green };
+ Col d2 { r2, maxSize.w = 0.5, bgColor = red };
+ Col d3 { r2, maxSize.w = 0.25, bgColor = blue };
+ Col d4 { r2, maxSize.w = 0.25, bgColor = green };
+
+ Bar rr { this, bgColor = beige, maxSize.h = 10 };
+
+ Bar r3 { this };
+ Col { r3, minSize.w = 30, maxSize.w = 0, bgColor = blue };
+ Col { r3, maxSize.w = 1.0, caption = "Hello", bgColor = green };
+ Col { r3, minSize.w = 30, maxSize.w = 0, bgColor = red };
+}
+*/
+
+class AutoLayoutForm : Window
+{
+ displayDriver = "OpenGL";
+ caption = "";
+ background = formColor;
+ borderStyle = sizable;
+ hasMaximize = true;
+ hasMinimize = true;
+ hasClose = true;
+ clientSize = { 640, 480 };
+
+ Element contents;
+
+ bool OnLoadGraphics()
+ {
+ contents.loadGraphics(displaySystem);
+ return true;
+ }
+
+ void OnResize(int width, int height)
+ {
+ int nw = contents.minSize.w.getPixels(width);
+ int nh = contents.minSize.h.getPixels(height);
+ contents.clientSize = { Max(nw, width), Max(nh, height) };
+ if(contents.nodes)
+ {
+ contents.computeContentSize(displaySystem);
+ contents.autoLayout();
+ }
+ Update(null);
+ }
+
+ void OnRedraw(Surface surface)
+ {
+ contents.render(surface);
+ }
+}
diff --git a/autoLayout/autoLayout/wrapText.ec b/autoLayout/autoLayout/wrapText.ec
new file mode 100644
index 0000000000..7cdb3e35a8
--- /dev/null
+++ b/autoLayout/autoLayout/wrapText.ec
@@ -0,0 +1,135 @@
+import IMPORT_STATIC "ecere"
+
+int wrapText(Surface surface, const String text, int sx, int sy, int ex, int ey)
+{
+ const String start = text;
+ const String drawUntil = null;
+ int w = 0;
+ int y = sy;
+ int tw, th;
+ int lh;
+
+ surface.TextExtent("W", 1, &tw, &th);
+ lh = th;
+ surface.Clip({ sx, sy, ex, ey });
+
+ while(true)
+ {
+ bool canAddMore = false;
+ if(ey - y >= 2*th)
+ {
+ const String s = drawUntil ? drawUntil + 1 : start;
+ const String nextSpace = strchr(s, ' ');
+ const String newLine = strchr(s, '\n');
+ if(newLine && (!nextSpace || (newLine < nextSpace)))
+ nextSpace = newLine;
+ if(!nextSpace)
+ nextSpace = strchr(s, 0);
+ if(nextSpace)
+ {
+ surface.TextExtent(drawUntil ? drawUntil : start, (int)(nextSpace - (drawUntil ? drawUntil : start)), &tw, &th);
+ if(!th) th = lh;
+ if(w + tw < ex - sx || !drawUntil)
+ {
+ drawUntil = nextSpace;
+ w += tw;
+ if(*nextSpace != 0 && *nextSpace != '\n')
+ canAddMore = true;
+ }
+ }
+ }
+ if(!canAddMore)
+ {
+ if(drawUntil)
+ {
+ surface.WriteText(sx, y, start, (int)(drawUntil - start));
+ w = 0;
+ y += th;
+ if(!*drawUntil)
+ break;
+ start = drawUntil + 1;
+ drawUntil = null;
+ }
+ else
+ {
+ surface.WriteText(sx, y, start, strlen(start));
+ y += th;
+ break;
+ }
+ }
+ }
+
+ surface.Clip(null);
+ return y;
+}
+
+int wrapTextExtent(DisplaySystem displaySystem, Font font, const String text, int ex, int ey, int * wtw, int * wth)
+{
+ const String start = text;
+ const String drawUntil = null;
+ int w = 0;
+ int y = 0;
+ int tw, th;
+ int lh;
+
+ displaySystem.FontExtent(font, "W", 1, &tw, &th);
+ lh = th;
+
+ *wtw = 0;
+ *wth = th;
+
+ while(true)
+ {
+ bool canAddMore = false;
+ if(ey - y >= 2*th)
+ {
+ const String s = drawUntil ? drawUntil + 1 : start;
+ const String nextSpace = strchr(s, ' ');
+ const String newLine = strchr(s, '\n');
+ if(newLine && (!nextSpace || (newLine < nextSpace)))
+ nextSpace = newLine;
+ if(!nextSpace)
+ nextSpace = strchr(s, 0);
+ if(nextSpace)
+ {
+ displaySystem.FontExtent(font, drawUntil ? drawUntil : start, (int)(nextSpace - (drawUntil ? drawUntil : start)), &tw, &th);
+ if(!th) th = lh;
+ if(w + tw < ex || !drawUntil)
+ {
+ drawUntil = nextSpace;
+ w += tw;
+ if(*nextSpace != 0 && *nextSpace != '\n')
+ canAddMore = true;
+ }
+ }
+ }
+ if(!canAddMore)
+ {
+ if(!drawUntil && !y && !w)
+ {
+ drawUntil = strchr(start, '\0');
+ if(drawUntil)
+ displaySystem.FontExtent(font, start, (int)(drawUntil - start), &w, &th);
+ }
+ if(drawUntil)
+ {
+ *wtw = Max(*wtw, w);
+ *wth = Max(*wth, y + th);
+ w = 0;
+ y += th;
+ if(!*drawUntil)
+ break;
+ start = drawUntil + 1;
+ drawUntil = null;
+ }
+ else
+ {
+ *wtw = Max(*wtw, w);
+ *wth = Max(*wth, y + th);
+ y += th;
+ break;
+ }
+ }
+ }
+ return y;
+}
diff --git a/autoLayout/base.ec b/autoLayout/base.ec
new file mode 100644
index 0000000000..101f143ef3
--- /dev/null
+++ b/autoLayout/base.ec
@@ -0,0 +1,46 @@
+import "autoLayout"
+
+class Title : Element { maxSize = { 1430, 0 }, font = { "Verdana", 60, bold = true }, fgColor = textColor; };
+class CCol : Col { hAlignment = center, vAlignment = center; };
+class BMBar : Bar { maxSize.h = 60; };
+class MBar : Bar { maxSize.h = 30; };
+define textColor = 0xFF2F3A3E;
+class Header : Element { font = { "Verdana", 50, bold = true }; fgColor = textColor; }
+class SmallHeader : Element { font = { "Verdana", 30, bold = true }; fgColor = textColor; }
+class Bullet : Element
+{
+ fgColor = textColor;
+ property const String caption
+ {
+ set { text.caption = value; }
+ get { return text.caption; }
+ }
+ Element bullet { this, caption = "â–ª ", fgColor = 0xFF104A4A; };
+ Col text { this, fgColor = textColor; };
+}
+
+class BaseSlide : CCol
+{
+ bitmap = { "graphics/bg1.png" };
+ bitmapTint = { 41, white };
+ bgColor = 0x59C6D2E3;
+ font = { "Verdana", 32 };
+}
+
+class CodeBlock : CCol
+{
+ selfHAlignment = center, selfVAlignment = center;
+ vAlignment = center;
+ maxSize = { };
+ //bgColor = { 180, 0x094B55 };
+ bgColor = { 220, black };
+ font = { "Consolas", 30 };
+
+ // Since we don't have padding yet
+ CCol text { this, fgColor = lime /*white*/; maxSize = { 1.0, 1.0 }; /*margin = { 20, 20, 20, 20 }*/ };
+ property const String caption
+ {
+ set { text.caption = value; }
+ get { return text.caption; }
+ }
+}
diff --git a/autoLayout/graphics/bg1.png b/autoLayout/graphics/bg1.png
new file mode 100644
index 0000000000..c6167e5e2d
Binary files /dev/null and b/autoLayout/graphics/bg1.png differ
diff --git a/autoLayout/ryanStyles/Animation.ec b/autoLayout/ryanStyles/Animation.ec
new file mode 100644
index 0000000000..3fe95a9ef7
--- /dev/null
+++ b/autoLayout/ryanStyles/Animation.ec
@@ -0,0 +1,54 @@
+import "ecere"
+import "Style"
+
+enum TweenMode {
+ size,
+ background,
+ border,
+ padding,
+ margin,
+ position
+};
+
+class KeyFrame {
+public:
+ Style style;
+ Array tween;
+ property Container tween {
+ set {
+ if(tween == null) {
+ tween = {};
+ }
+ for(mode : value) {
+ tween.Add(mode);
+ }
+ }
+ }
+};
+
+class Timeline {
+ Map frames {};
+};
+
+class Animation {
+ Timeline timeline;
+};
+
+void Test() {
+ Animation a { };
+ a.timeline = {
+ frames = {[
+ {0.0, {
+ style = {
+ background={color=red}
+ },
+ tween=[background]
+ }},
+ {1.0, {
+ style = {
+ background={color=blue}
+ }
+ }}
+ ]}
+ };
+}
\ No newline at end of file
diff --git a/autoLayout/ryanStyles/Button.ec b/autoLayout/ryanStyles/Button.ec
new file mode 100644
index 0000000000..ca86164879
--- /dev/null
+++ b/autoLayout/ryanStyles/Button.ec
@@ -0,0 +1,59 @@
+import "ecere"
+import "Layout"
+import "Style"
+
+class LayoutButton : LayoutWindow {
+public:
+ Style styleDown;
+ bool pressedDown;
+ Container