+ARCH ?= arm
+CROSS_COMPILE ?= arm-linux-
CC = $(CROSS_COMPILE)gcc
AS = $(CROSS_COMPILE)as
CFLAGS += -Wall -ggdb
LDFLAGS += -static -ggdb
+ifndef DEBUG
+CFLAGS += -O2 -fno-strict-aliasing
+LDFLAGS += -s -O2
+endif
-ifndef ARCH
+ifeq "$(ARCH)" "ia32"
ARCH = ia32
CFLAGS += -m32
LDFLAGS += -m32
OBJ += sys_cacheflush.o
endif
+vpath %.c = ../common/
+
OBJ += loader.o loader_$(ARCH).o patches.o emu.o host_fb.o host_pnd.o
-loader: $(OBJ)
+ginge_sloader: LDFLAGS += -Wl,-T script_$(ARCH).lds
-loader: LDFLAGS += -Wl,-T script_$(ARCH).lds
+ginge_sloader: $(OBJ)
+ $(CC) -o $@ $^ $(LDFLAGS)
clean:
$(RM) loader $(OBJ)