| 1 | CFLAGS += -ggdb -Wall |
| 2 | ifndef DEBUG |
| 3 | CFLAGS += -O2 |
| 4 | endif |
| 5 | |
| 6 | include ../../config.mak |
| 7 | |
| 8 | OBJS += gpu.o |
| 9 | |
| 10 | ifeq "$(ARCH)" "arm" |
| 11 | OBJS += vout_pl.o |
| 12 | EXT = a |
| 13 | else |
| 14 | #CFLAGS += `sdl-config --cflags` |
| 15 | #OBJS += vout_sdl.o |
| 16 | OBJS += vout_pl.o |
| 17 | EXT = $(ARCH).a |
| 18 | endif |
| 19 | CFLAGS += $(PLUGIN_CFLAGS) |
| 20 | |
| 21 | # need to compile to another dir, same files are compiled |
| 22 | # into main binary without PIC |
| 23 | OBJS2 = $(patsubst %.o,obj/%.o,$(OBJS)) |
| 24 | |
| 25 | TARGET = gpulib.$(EXT) |
| 26 | |
| 27 | all: ../../config.mak obj $(TARGET) |
| 28 | |
| 29 | $(TARGET): $(OBJS2) |
| 30 | $(AR) crs $@ $^ |
| 31 | |
| 32 | obj/%.o: %.c |
| 33 | $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $^ |
| 34 | |
| 35 | obj/%.o: %.s |
| 36 | $(AS) $(ASFLAGS) -o $@ $^ |
| 37 | |
| 38 | clean: |
| 39 | $(RM) $(TARGET) $(OBJS2) |
| 40 | |
| 41 | obj: |
| 42 | mkdir -p $@ |
| 43 | |
| 44 | ../../config.mak: |
| 45 | @echo "Please run ./configure before running make!" |
| 46 | @exit 1 |