libretro: try to prevent bad builds
[pcsx_rearmed.git] / plugins / gpulib / gpulib.mak
CommitLineData
62d7fa95 1# depends on ARCH definition
c82f907a 2# always adding gpulib to deps (XXX might be no longer needed)
4132e8ca 3# users must include ../../config.mak
62d7fa95 4
22fa3f2b 5LDFLAGS += -shared -Wl,--no-undefined
4132e8ca 6CFLAGS += $(PLUGIN_CFLAGS)
62d7fa95 7ifeq "$(ARCH)" "arm"
62d7fa95 8 EXT =
9else
ac6575cd 10 #LDLIBS_GPULIB += `sdl-config --libs`
4132e8ca 11 EXT = .$(ARCH)
62d7fa95 12endif
62d7fa95 13ifdef DEBUG
14 CFLAGS += -O0
15endif
16
17GPULIB_A = ../gpulib/gpulib$(EXT).a
62d7fa95 18
e83c4fdc 19ifdef BIN_STANDALONE
20TARGETS += $(BIN_STANDALONE)
62d7fa95 21endif
22ifdef BIN_GPULIB
ddd99692 23TARGETS += $(BIN_GPULIB)
62d7fa95 24endif
ac6575cd 25CC_STANDLALONE = $(CC)
26CC_GPULIB = $(CC)
62d7fa95 27
dd4d5a35 28WD = $(shell pwd)
29PLUGINDIR = $(shell basename $(WD))
30
4132e8ca 31all: ../../config.mak $(TARGETS)
62d7fa95 32
e83c4fdc 33ifdef BIN_STANDALONE
ac6575cd 34ifneq ($(findstring .cpp,$(SRC_STANDALONE)),)
35CC_STANDLALONE = $(CXX)
36endif
e83c4fdc 37$(BIN_STANDALONE): $(SRC) $(SRC_STANDALONE) $(GPULIB_A)
ac6575cd 38 $(CC_STANDLALONE) -o $@ $(CFLAGS) $(LDFLAGS) $^ $(LDLIBS) $(LDLIBS_STANDALONE)
dd4d5a35 39 ln -fs $(PLUGINDIR)/$@ ../
62d7fa95 40endif
41
42ifdef BIN_GPULIB
ac6575cd 43ifneq ($(findstring .cpp,$(SRC_GPULIB)),)
44CC_GPULIB = $(CXX)
45endif
ddd99692 46$(BIN_GPULIB): $(SRC) $(SRC_GPULIB) $(GPULIB_A)
ac6575cd 47 $(CC_GPULIB) -o $@ $(CFLAGS) $(LDFLAGS) $^ $(LDLIBS) $(LDLIBS_GPULIB)
dd4d5a35 48 ln -fs $(PLUGINDIR)/$@ ../
62d7fa95 49endif
50
51$(GPULIB_A):
52 make -C ../gpulib/ all
53
54clean:
55 $(RM) $(TARGETS)
4132e8ca 56
57../../config.mak:
58 @echo "Please run ./configure before running make!"
59 @exit 1