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