Usermode/AxWin4 - Clean up logging
[tpg/acess2.git] / AcessNative / libacess-native.so_src / Makefile
1 #
2 #
3
4 ifeq ($(PLATFORM),)
5         PLATFORM := lin
6 endif
7
8 OBJ := main.o syscalls.o request.o memory.o exports.o heap.o
9 OBJ := $(addprefix obj-$(PLATFORM)/,$(OBJ))
10
11 ifeq ($(PLATFORM),win)
12         BIN := ../libacess-native.dll
13         LDFLAGS += -lws2_32
14 endif
15 ifeq ($(PLATFORM),lin)
16         BIN := ../libacess-native.so
17 endif
18 BINLINK := ../../Usermode/Output/native/Libs/$(notdir $(BIN))
19 $(warning $(BINLINK))
20
21 CFLAGS   += -Wall
22 CFLAGS   += -Werror
23 CFLAGS   += -g -shared -fPIC -std=c99
24 CPPFLAGS += -DARCHDIR_is_x86_64=1
25 LDFLAGS  += -g -shared -Wl,--no-undefined -lc
26
27 DEPFILES  = $(filter %.o,$(OBJ))
28 DEPFILES := $(DEPFILES:%=%.dep)
29
30 .PHONY: all clean
31
32 all: $(BIN) $(BINLINK)
33
34 clean:
35         $(RM) $(BIN) $(OBJ) $(DEPFILES)
36
37 $(BIN): $(OBJ)
38         $(CC) -o $@ $(OBJ) $(LDFLAGS)
39         objdump -S $@ > [email protected]
40
41 $(BINLINK): $(BIN)
42         @mkdir -p $(dir $@)
43         @cd $(dir $@) && ln -sf ../../../../AcessNative/$(notdir $@)
44
45 obj-$(PLATFORM)/%.o: %.c
46         @mkdir -p $(dir $@)
47         @echo [CC] -o $@
48         @$(CC) -c $< -o $@ $(CFLAGS) $(CPPFLAGS)
49         @$(CC) -M $(CPPFLAGS) -MT $@ -o [email protected] $<
50
51 -include $(DEPFILES)
52

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