# Acess 2 Libraries
# General Makefile
--include $(dir $(lastword $(MAKEFILE_LIST)))../Makefile.cfg
+_libsdir := $(dir $(lastword $(MAKEFILE_LIST)))
+-include $(_libsdir)../Makefile.cfg
+USE_CXX_LINK :=
+PRELINK :=
MAKEDEP = $(CC) -M
-ASFLAGS := -felf
-CPPFLAGS := -I$(ACESSDIR)/Usermode/include/
-CFLAGS := -g -Wall -fPIC -fno-builtin -fno-stack-protector $(CPPFLAGS)
-LDFLAGS := -g -nostdlib -shared -I/Acess/Libs/ld-acess.so -e SoMain -x -L$(OUTPUTDIR)Libs/
+ifeq ($(ARCHDIR),native)
+ ASFLAGS += -D ARCHDIR=$(ARCHDIR) -D __ASSEMBLER__=1
+ LDFLAGS :=
+ LIBS := -lacess-native
+ #CPPFLAGS := -D SoMain="__attribute__ ((constructor(101))) libacessnative_init"
+ ifeq ($(PLATFORM),windows)
+ 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
+ LIBS := -lld-acess
+else
+ CFLAGS := -fno-stack-protector -fPIC
+ CXXFLAGS := -fno-stack-protector -fPIC
+ LDFLAGS :=
+ LIBS := -lld-acess
+endif
+LDFLAGS += -g -shared -eSoStart -L$(OUTPUTDIR)Libs/ --no-undefined
+CXXFLAGS += -std=gnu++11
+#CPPFLAGS += -D 'SoMain(...)=SoMain(__VA_ARGS__) __attribute__ ((visibility ("hidden"))); int SoMain(__VA_ARGS__)'
+
+-include $(_libsdir)../common_settings.mk
+
+# vim: ft=make