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