Commit | Line | Data |
---|---|---|
1ab64c54 | 1 | CC = $(CROSS_COMPILE)gcc |
6f2ee2be | 2 | CXX = $(CROSS_COMPILE)g++ |
3 | CC_ = $(CC) | |
56f08d83 | 4 | |
5 | ARCH = $(shell $(CC) -v 2>&1 | grep -i 'target:' | awk '{print $$2}' | awk -F '-' '{print $$1}') | |
6 | ||
7 | CFLAGS += -ggdb -Wall -fPIC -O2 | |
b094071f | 8 | CFLAGS += -fno-strict-aliasing |
b3db9409 | 9 | ifdef MAEMO |
10 | CFLAGS += -DMAEMO | |
11 | endif | |
1ab64c54 | 12 | |
56f08d83 | 13 | SRC += gpu.c |
14 | ifeq "$(ARCH)" "arm" | |
7d993ee2 | 15 | ARM_CORTEXA8 ?= 1 |
16 | ifeq "$(ARM_CORTEXA8)" "1" | |
56f08d83 | 17 | CFLAGS += -mcpu=cortex-a8 -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp |
7d993ee2 | 18 | SRC += ../../frontend/cspace_neon.s |
19 | else | |
20 | CFLAGS += -mcpu=arm926ej-s -mtune=arm926ej-s | |
21 | SRC += ../../frontend/cspace.c | |
22 | endif | |
23 | SRC += vout_fb.c | |
6f2ee2be | 24 | EXT = so |
25 | endif | |
26 | ifeq "$(ARCH)" "x86_64" | |
56f08d83 | 27 | CFLAGS += `sdl-config --cflags` -m32 |
28 | LDFLAGS += `sdl-config --libs` | |
29 | SRC += vout_sdl.c | |
6f2ee2be | 30 | EXT = so.x86 |
56f08d83 | 31 | endif |
1ab64c54 | 32 | |
7d993ee2 | 33 | HAVE_NEON = $(shell $(CC_) -E -dD $(CFLAGS) gpu.h | grep -q '__ARM_NEON__ 1' && echo 1) |
34 | ||
35 | TARGETS = gpu_peops.$(EXT) gpu_unai.$(EXT) | |
36 | ifeq "$(HAVE_NEON)" "1" | |
37 | TARGETS += gpu_neon.$(EXT) | |
38 | endif | |
6f2ee2be | 39 | |
90ca4913 | 40 | gpu_neon.$(EXT): SRC += psx_gpu_if.c psx_gpu/psx_gpu_arm_neon.S |
41 | gpu_neon.$(EXT): CFLAGS += -DNEON_BUILD -DTEXTURE_CACHE_4BPP -DTEXTURE_CACHE_8BPP | |
6f2ee2be | 42 | gpu_peops.$(EXT): SRC += peops_if.c |
43 | gpu_peops.$(EXT): CFLAGS += -fno-strict-aliasing | |
b3db9409 | 44 | gpu_unai.$(EXT): SRC += unai_if.cpp ../gpu_unai/gpu_arm.s |
6f2ee2be | 45 | gpu_unai.$(EXT): CC_ = $(CXX) |
46 | ||
47 | all: $(TARGETS) | |
1ab64c54 | 48 | |
6f2ee2be | 49 | $(TARGETS): $(SRC) |
50 | $(CC_) -o $@ $(SRC) $(CFLAGS) $(LDFLAGS) -shared -Wl,-soname,$@ | |
1ab64c54 GI |
51 | |
52 | clean: | |
6f2ee2be | 53 | $(RM) $(TARGETS) |