summaryrefslogtreecommitdiff
path: root/Makefile.trimui
blob: 25fe88ebc32eaabd79d0f5cba2c7db66137518ec (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# gpSP makefile
# Gilead Kutnick - Exophase
# pandora port - notaz
# respberry pi - DPR

# Global definitions

CC        = $(CROSS_COMPILE)gcc
SYSROOT   = $(shell $(CC) --print-sysroot)

OBJS      = main.o cpu.o gba_memory.o video.o input.o sound.o gba_cc_lut.o \
            bios_data.o cheats.o zip.o arm/arm_stub.o cpu_threaded.o arm/video_blend.o \
            frontend/libpicofe/input.o frontend/libpicofe/in_sdl.o \
            frontend/libpicofe/linux/in_evdev.o frontend/libpicofe/linux/plat.o \
            frontend/libpicofe/fonts.o frontend/libpicofe/readpng.o frontend/libpicofe/config_file.o \
            frontend/config.o frontend/menu.o frontend/plat_trimui.o frontend/main.o frontend/scale.o

BIN       = picogpsp

# Platform specific definitions 

VPATH      += .. ../arm
CFLAGS     += -DARM_ARCH -DARM_ARCH_BLENDING_OPTS -DPC_BUILD -Wall -DHAVE_DYNAREC
CFLAGS     += -Ofast -fdata-sections -ffunction-sections -flto -fno-PIC -DPICO_HOME_DIR='"/.picogpsp/"'
CFLAGS     += -I./ $(shell $(SYSROOT)/usr/bin/sdl-config --cflags)

# expecting to have PATH set up to get correct sdl-config first

LIBS       = -lc -lgcc -lSDL -lasound -lpng -lz -Wl,--as-needed -Wl,--gc-sections -flto -s

ifeq ($(PROFILE), YES)
CFLAGS	+= -fprofile-generate=./profile
LIBS	+= -lgcov
else ifeq ($(PROFILE), APPLY)
CFLAGS	+= -fprofile-use -fprofile-dir=./profile -fbranch-probabilities
endif

# Compilation:

all: $(BIN)

%.o: %.S
	$(CC) $(CFLAGS) -c -o $@ $<


cpu.o cpu_threaded.o: CFLAGS += -Wno-unused-variable -Wno-unused-label

$(BIN): $(OBJS)
	$(CC) $(OBJS) $(LIBS) -o $(BIN)

clean:
	rm -f $(OBJS) $(BIN)