Usermode/ld-acess - Fixes for clang compilation
[tpg/acess2.git] / Usermode / Libraries / ld-acess.so_src / Makefile
index 2a7a186..5475fdc 100644 (file)
@@ -5,12 +5,15 @@
 -include ../Makefile.cfg
 
 OBJ := main.o lib.o loadlib.o export.o elf.o pe.o
-OBJ += arch/$(ARCHDIR).ao
+OBJ += arch/$(ARCHDIR).ao_
 BIN = ld-acess.so
 EXTRABIN := libld-acess.so
+EXTRACLEAN := $(_OBJPREFIX)_stublib.o
+INCFILES := sys/sys.h
 
-CFLAGS   = -g -Wall -fno-builtin -fno-leading-underscore -fno-stack-protector -fPIC
-CFLAGS  += $(CPPFLAGS)
+CFLAGS   = -g -Wall -fno-builtin -fno-stack-protector -fPIC
+# -fno-leading-underscore
+CFLAGS  += $(CPPFLAGS) -Werror
 LDFLAGS  = -g -T arch/$(ARCHDIR).ld -Map map.txt --export-dynamic
 
 include ../Makefile.tpl
@@ -18,21 +21,23 @@ include ../Makefile.tpl
 # create libld-acess.so
 $(_XBIN): $(_OBJPREFIX)_stublib.o
        @echo [LD] -o -shared libld-acess.so
-       $(LD) -shared -o $@ $<
+       $(LD) -shared -o $@ $< $(LDFLAGS)
 #      @$(LD) $(LDFLAGS) -o $@ $(OBJ)
 
 
 # Override .ao to look in the object prefix for the source
-%.ao: %.$(ASSUFFIX)
+$(_OBJPREFIX)arch/$(ARCHDIR).ao_: $(_OBJPREFIX)arch/$(ARCHDIR).$(ASSUFFIX)
        @echo [AS] -o $@
        @mkdir -p $(dir $@)
        @$(AS) $(ASFLAGS) -o $@ $<
 
-.PRECIOUS: $(OBJ:%.ao=%.asm)
+#.PRECIOUS: $(OBJ:%.ao=%.asm)
 
 # Preprocessing objects if needed
-$(_OBJPREFIX)%: %.h
+$(_OBJPREFIX)arch/$(ARCHDIR).$(ASSUFFIX): arch/$(ARCHDIR).$(ASSUFFIX).h arch/syscalls.s.h
        @echo [CPP] -o $@
        @mkdir -p $(dir $@)
-       @$(CPP) $(CPPFLAGS) -P -D__ASM__ $< -o $@
+       @$(CPP) $(CPPFLAGS) -P -D__ASSEMBLER__ $< -o $@
+
+$(_OBJPREFIX)_stublib.o: arch/syscalls.s.h
 

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