-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
119 lines (81 loc) · 2.62 KB
/
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
### Generated by Winemaker 0.8.4
###
### Invocation command line was
### /usr/bin/winemaker --nosource-fix --dll --nomfc --wine32 -lsixense .
SRCDIR = .
SUBDIRS =
DLLS = sixense.dll
LIBS =
EXES =
### Common settings
CEXTRA = -mno-cygwin \
-m32
CXXEXTRA = -m32
RCEXTRA =
DEFINES =
INCLUDE_PATH = -I.
DLL_PATH =
DLL_IMPORTS =
LIBRARY_PATH =
LIBRARIES = -lsixense
### sixense.dll sources and settings
sixense_dll_MODULE = sixense.dll
sixense_dll_C_SRCS = sixense_main.c
sixense_dll_CXX_SRCS =
sixense_dll_RC_SRCS =
sixense_dll_LDFLAGS = -shared \
$(sixense_dll_MODULE:.dll=.spec) \
-mno-cygwin \
-m32
sixense_dll_ARFLAGS =
sixense_dll_DLL_PATH =
sixense_dll_DLLS = odbc32 \
ole32 \
oleaut32 \
winspool \
odbccp32
sixense_dll_LIBRARY_PATH=
sixense_dll_LIBRARIES = uuid
sixense_dll_OBJS = $(sixense_dll_C_SRCS:.c=.o) \
$(sixense_dll_CXX_SRCS:.cpp=.o) \
$(sixense_dll_RC_SRCS:.rc=.res)
### Global source lists
C_SRCS = $(sixense_dll_C_SRCS)
CXX_SRCS = $(sixense_dll_CXX_SRCS)
RC_SRCS = $(sixense_dll_RC_SRCS)
### Tools
CC = winegcc
CXX = wineg++
RC = wrc
AR = ar
### Generic targets
all: $(SUBDIRS) $(DLLS:%=%.so) $(LIBS) $(EXES)
### Build rules
.PHONY: all clean dummy
$(SUBDIRS): dummy
@cd $@ && $(MAKE)
# Implicit rules
.SUFFIXES: .cpp .cxx .rc .res
DEFINCL = $(INCLUDE_PATH) $(DEFINES) $(OPTIONS)
.c.o:
$(CC) -c $(CFLAGS) $(CEXTRA) $(DEFINCL) -o $@ $<
.cpp.o:
$(CXX) -c $(CXXFLAGS) $(CXXEXTRA) $(DEFINCL) -o $@ $<
.cxx.o:
$(CXX) -c $(CXXFLAGS) $(CXXEXTRA) $(DEFINCL) -o $@ $<
.rc.res:
$(RC) $(RCFLAGS) $(RCEXTRA) $(DEFINCL) -fo$@ $<
# Rules for cleaning
CLEAN_FILES = y.tab.c y.tab.h lex.yy.c core *.orig *.rej \
\\\#*\\\# *~ *% .\\\#*
clean:: $(SUBDIRS:%=%/__clean__) $(EXTRASUBDIRS:%=%/__clean__)
$(RM) $(CLEAN_FILES) $(RC_SRCS:.rc=.res) $(C_SRCS:.c=.o) $(CXX_SRCS:.cpp=.o)
$(RM) $(DLLS:%=%.so) $(LIBS) $(EXES) $(EXES:%=%.so)
$(SUBDIRS:%=%/__clean__): dummy
cd `dirname $@` && $(MAKE) clean
$(EXTRASUBDIRS:%=%/__clean__): dummy
-cd `dirname $@` && $(RM) $(CLEAN_FILES)
### Target specific build rules
DEFLIB = $(LIBRARY_PATH) $(LIBRARIES) $(DLL_PATH) $(DLL_IMPORTS:%=-l%)
$(sixense_dll_MODULE).so: $(sixense_dll_OBJS) $(sixense_dll_MODULE:.dll=.spec)
$(CC) $(sixense_dll_LDFLAGS) -o $@ $(sixense_dll_OBJS) $(sixense_dll_LIBRARY_PATH) $(sixense_dll_DLL_PATH) $(DEFLIB) $(sixense_dll_DLLS:%=-l%) $(sixense_dll_LIBRARIES:%=-l%)