-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
38 lines (30 loc) · 931 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
CPPFLAGS += -Wall -Wextra
ifeq ($(DEBUG), 1)
CFLAGS += -g
CPPFLAGS += -Werror
else
CFLAGS += -O2
CPPFLAGS += -DNDEBUG
endif
ifeq ($(METHOD),)
METHOD = 2
endif
CPPFLAGS += -D GH_DLSYM_METHOD=$(METHOD)
STDDEFINES=-DGH_CONTEXT_TRACKING -DGH_SWAPBUFFERS_INTERCEPT
BAREDEFINES=
BASEFILES=glx_hook.so glx_hook_bare.so
.PHONY: all
ifeq ($(METHOD),3)
all: $(BASEFILES) dlsym_wrapper.so
else
all: $(BASEFILES)
endif
glx_hook.so: glx_hook.c dlsym_wrapper.h Makefile
$(CC) -shared -fPIC -Bsymbolic -pthread -o $@ $< $(CPPFLAGS) $(STDDEFINES) $(CFLAGS) $(LDFLAGS) -lrt
glx_hook_bare.so: glx_hook.c dlsym_wrapper.h Makefile
$(CC) -shared -fPIC -Bsymbolic -pthread -o $@ $< $(CPPFLAGS) $(BAREDEFINES) $(CFLAGS) $(LDFLAGS)
dlsym_wrapper.so: dlsym_wrapper.c dlsym_wrapper.h Makefile
$(CC) -shared -fPIC -Bsymbolic -o $@ $< $(CPPFLAGS) $(BAREDEFINES) $(CFLAGS) $(LDFLAGS) -ldl
.PHONY: clean
clean:
-rm $(BASEFILES) dlsym_wrapper.so