wip, fb sync thread
[ginge.git] / loader / Makefile
index 67dd24c..d50bcd5 100644 (file)
@@ -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
 
-OBJ += loader.o loader_$(ARCH).o patches.o emu.o
+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)