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