0881206b |
1 | ARCH ?= arm |
2 | CROSS_COMPILE ?= arm-linux- |
11913091 |
3 | CC = $(CROSS_COMPILE)gcc |
4 | AS = $(CROSS_COMPILE)as |
7fd42181 |
5 | CFLAGS += -Wall -ggdb -DLOADER |
6 | LDFLAGS += -ggdb -lpthread -lrt |
0881206b |
7 | ifndef DEBUG |
8 | CFLAGS += -O2 -fno-strict-aliasing |
9 | LDFLAGS += -s -O2 |
10 | endif |
7fd42181 |
11 | ifdef DBG |
12 | CFLAGS += -DDBG=$(DBG) |
13 | endif |
11913091 |
14 | |
0881206b |
15 | ifeq "$(ARCH)" "ia32" |
11913091 |
16 | ARCH = ia32 |
17 | CFLAGS += -m32 |
18 | LDFLAGS += -m32 |
19 | ASFLAGS += --32 |
20 | endif |
21 | ifeq "$(ARCH)" "arm" |
22 | ASFLAGS += -mfloat-abi=soft |
3d3fa63b |
23 | OBJ += sys_cacheflush.o emu_arm.o |
11913091 |
24 | endif |
4d045184 |
25 | ifdef PND |
26 | CFLAGS += -DPND |
cf0a08ff |
27 | TAG = _pnd |
4d045184 |
28 | endif |
29 | ifdef WIZ |
30 | CFLAGS += -DWIZ |
ad439e71 |
31 | OBJ += wiz_video_arm.o |
cf0a08ff |
32 | TAG = _wiz |
4d045184 |
33 | endif |
11913091 |
34 | |
2ce69bdf |
35 | vpath %.c = ../common/ |
6ca08393 |
36 | vpath %.s = ../common/ |
2ce69bdf |
37 | |
cf0a08ff |
38 | TARGET_S = ginge_sloader$(TAG) |
39 | TARGET_D = ginge_dyn$(TAG) |
7fd42181 |
40 | |
ad439e71 |
41 | OBJ += emu.o host.o host_fb.o cmn.o |
8424752c |
42 | OBJ += ../common/libpicofe/input.o |
43 | OBJ += ../common/libpicofe/linux/plat.o |
44 | OBJ += ../common/libpicofe/linux/in_evdev.o |
7fd42181 |
45 | OBJ_S += $(OBJ) loader.o loader_$(ARCH).o patches.o |
46 | OBJ_D += $(OBJ) dl.o |
47 | |
48 | all: $(TARGET_S) $(TARGET_D) |
11913091 |
49 | |
7fd42181 |
50 | $(TARGET_S): LDFLAGS += -Wl,-T script_$(ARCH).lds |
cf0a08ff |
51 | $(TARGET_D): LDFLAGS += -ldl -Wl,--version-script=ginge_dyn.symver |
11913091 |
52 | |
7fd42181 |
53 | $(TARGET_S): $(OBJ_S) |
54 | $(CC) -o $@ $^ -static $(LDFLAGS) |
55 | |
56 | $(TARGET_D): $(OBJ_D) |
57 | $(CC) -o $@ $^ -shared $(LDFLAGS) |
11913091 |
58 | |
59 | clean: |
7fd42181 |
60 | $(RM) $(TARGET_S) $(TARGET_D) $(OBJ_S) $(OBJ_D) |
61 | |
62 | # basic deps |
63 | dl.o patches.o: override.c |
64 | *.o: header.h |
8424752c |
65 | host_fb.o: libpicofe/linux/fbdev.c |