Usermode - POSIX and C conformance changes
[tpg/acess2.git] / Usermode / Libraries / Makefile.cfg
index 9192194..c3cb7b1 100644 (file)
@@ -5,7 +5,23 @@
 
 MAKEDEP  = $(CC) -M
 
-ASFLAGS  += -D ARCHDIR=$(ARCHDIR)
-CPPFLAGS := -I$(ACESSDIR)/Usermode/include/ -D ARCHDIR=$(ARCHDIR) -D ARCHDIR_IS_$(ARCHDIR)=1
-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 := -lacess-native
+ #CPPFLAGS := -D SoMain="__attribute__ ((constructor(101))) libacessnative_init"
+ ifeq ($(PLATFORM),windows)
+ else
+  LDFLAGS += -Wl,-init,SoMain
+  CFLAGS += -fPIC
+ endif
+else
+CPPFLAGS := -ffreestanding
+CFLAGS   := -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/
+
+# vim: ft=make

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