X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?p=ginge.git;a=blobdiff_plain;f=loader%2FMakefile;h=d50bcd538227276490bb387104fb11fe2737b718;hp=5055ac7f7ce2f54666492805376d2533ca3e9449;hb=c1ffd5ba04171a30be808e2c485e0dd6e25fa48a;hpb=3d295a9fe6e27f6103701e8d8ae23257b43ff2dd diff --git a/loader/Makefile b/loader/Makefile index 5055ac7..d50bcd5 100644 --- a/loader/Makefile +++ b/loader/Makefile @@ -1,9 +1,15 @@ +ARCH ?= arm +CROSS_COMPILE ?= arm-linux- CC = $(CROSS_COMPILE)gcc AS = $(CROSS_COMPILE)as CFLAGS += -Wall -ggdb -LDFLAGS += -static -ggdb +LDFLAGS += -static -ggdb -lpthread -lrt +ifndef DEBUG +CFLAGS += -O2 -fno-strict-aliasing +LDFLAGS += -s -O2 +endif -ifndef ARCH +ifeq "$(ARCH)" "ia32" ARCH = ia32 CFLAGS += -m32 LDFLAGS += -m32 @@ -14,11 +20,15 @@ ASFLAGS += -mfloat-abi=soft OBJ += sys_cacheflush.o endif +vpath %.c = ../common/ + +TARGET = ginge_sloader OBJ += loader.o loader_$(ARCH).o patches.o emu.o host_fb.o host_pnd.o -loader: $(OBJ) +$(TARGET): LDFLAGS += -Wl,-T script_$(ARCH).lds -loader: LDFLAGS += -Wl,-T script_$(ARCH).lds +$(TARGET): $(OBJ) + $(CC) -o $@ $^ $(LDFLAGS) clean: - $(RM) loader $(OBJ) + $(RM) $(TARGET) $(OBJ)