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 |
5 | LDFLAGS += -shared -Wl,--no-undefined |
4132e8ca |
6 | CFLAGS += $(PLUGIN_CFLAGS) |
62d7fa95 |
7 | ifeq "$(ARCH)" "arm" |
62d7fa95 |
8 | EXT = |
9 | else |
ac6575cd |
10 | #LDLIBS_GPULIB += `sdl-config --libs` |
4132e8ca |
11 | EXT = .$(ARCH) |
62d7fa95 |
12 | endif |
62d7fa95 |
13 | ifdef DEBUG |
14 | CFLAGS += -O0 |
15 | endif |
16 | |
17 | GPULIB_A = ../gpulib/gpulib$(EXT).a |
62d7fa95 |
18 | |
e83c4fdc |
19 | ifdef BIN_STANDALONE |
20 | TARGETS += $(BIN_STANDALONE) |
62d7fa95 |
21 | endif |
22 | ifdef BIN_GPULIB |
ddd99692 |
23 | TARGETS += $(BIN_GPULIB) |
62d7fa95 |
24 | endif |
ac6575cd |
25 | CC_STANDLALONE = $(CC) |
26 | CC_GPULIB = $(CC) |
62d7fa95 |
27 | |
dd4d5a35 |
28 | WD = $(shell pwd) |
29 | PLUGINDIR = $(shell basename $(WD)) |
30 | |
4132e8ca |
31 | all: ../../config.mak $(TARGETS) |
62d7fa95 |
32 | |
e83c4fdc |
33 | ifdef BIN_STANDALONE |
ac6575cd |
34 | ifneq ($(findstring .cpp,$(SRC_STANDALONE)),) |
35 | CC_STANDLALONE = $(CXX) |
36 | endif |
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 |
40 | endif |
41 | |
42 | ifdef BIN_GPULIB |
ac6575cd |
43 | ifneq ($(findstring .cpp,$(SRC_GPULIB)),) |
44 | CC_GPULIB = $(CXX) |
45 | endif |
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 |
49 | endif |
50 | |
51 | $(GPULIB_A): |
c292798a |
52 | $(MAKE) -C ../gpulib/ all |
62d7fa95 |
53 | |
54 | clean: |
55 | $(RM) $(TARGETS) |
4132e8ca |
56 | |
57 | ../../config.mak: |
58 | @echo "Please run ./configure before running make!" |
59 | @exit 1 |