Usermode/AxWin4 - Starting work on client-side library
[tpg/acess2.git] / Usermode / Libraries / Makefile.cfg
index c3cb7b1..113e65c 100644 (file)
@@ -1,7 +1,8 @@
 # Acess 2 Libraries
 # General Makefile
 
--include $(dir $(lastword $(MAKEFILE_LIST)))../Makefile.cfg
+_libsdir := $(dir $(lastword $(MAKEFILE_LIST)))
+-include $(_libsdir)../Makefile.cfg
 
 MAKEDEP  = $(CC) -M
 
@@ -13,15 +14,27 @@ ifeq ($(ARCHDIR),native)
  else
   LDFLAGS += -Wl,-init,SoMain
   CFLAGS += -fPIC
+  CXXFLAGS += -fPIC
+ endif
+else ifneq ($(HOST_ARCH),)
+ ASFLAGS += -D ARCHDIR=$(ARCHDIR) -D __ASSEMBLER__=1
+ #CPPFLAGS := -D SoMain="__attribute__ ((constructor(101))) libacessnative_init"
+ LD := $(CC)
+ ifeq ($(PLATFORM),windows)
+ else
+  LDFLAGS += -Wl,-init,SoMain
+  CFLAGS += -fPIC
+  CXXFLAGS += -fPIC
  endif
 else
-CPPFLAGS := -ffreestanding
-CFLAGS   := -fno-stack-protector -fPIC
-LDFLAGS  := -I/Acess/Libs/ld-acess.so -lld-acess `$(CC) -print-libgcc-file-name`
+ CPPFLAGS := -ffreestanding
+ CFLAGS   := -fno-stack-protector -fPIC
+ CXXFLAGS   := -fno-stack-protector -fPIC
+ LDFLAGS  := -I/Acess/Libs/ld-acess.so -lld-acess `$(CC) -print-libgcc-file-name`
 endif
-CPPFLAGS += -I$(ACESSDIR)/Usermode/include/ -DARCHDIR=$(ARCHDIR) -DARCHDIR_is_$(ARCHDIR)=1
-CPPFLAGS += $(addprefix -I,$(wildcard $(ACESSUSERDIR)Libraries/*/include_exp/))
-CFLAGS += -Wall -g
-LDFLAGS += -g -nostdlib -shared -eSoMain -x --no-undefined -L$(OUTPUTDIR)Libs/
+LDFLAGS += -g -nostdlib -shared -eSoMain -x --no-undefined -L$(OUTPUTDIR)Libs/ --defsym __dso_handle=SoMain
+CXXFLAGS += -std=gnu++11
+
+-include $(_libsdir)../common_settings.mk
 
 # vim: ft=make

UCC git Repository :: git.ucc.asn.au