-
Notifications
You must be signed in to change notification settings - Fork 11
/
Makefile-commands
191 lines (156 loc) · 3.84 KB
/
Makefile-commands
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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
########## smooth commands makefile ##########
include $(dir $(firstword $(MAKEFILE_LIST)))/$(SMOOTH_PATH)/Makefile-options
CCOPTS = -I"$(SRCDIR)"/$(SMOOTH_PATH)/include $(MYCCOPTS)
RC = windres
RCOPTS = -DSMOOTH_DLL -O coff
LDOPTS = -L"$(SRCDIR)"/$(SMOOTH_PATH)/$(LIBDIR) $(LIBS)
ifndef GLOBALDLL
CCOPTS += -fvisibility=hidden
ifeq ($(BUILD_WIN32),True)
LDOPTS += -lsmooth
else
LDOPTS += -lsmooth-$(VERSION)
endif
endif
ifeq ($(BUILD_WIN32),True)
CCOPTS += -DUNICODE -D_UNICODE
LDOPTS += -mwindows -Wl,--dynamicbase,--nxcompat
ifdef IMPORTLIB
ifdef GLOBALDLL
LDOPTS += -Wl,--out-implib,$(SMOOTH_PATH)/$(LIBDIR)/$(IMPORTLIB)
else
LDOPTS += -Wl,--out-implib,$(IMPORTLIB)
endif
endif
ifeq ($(BUILD_X86),True)
RCOPTS += --target=pe-i386
else ifeq ($(BUILD_X86_64),True)
RCOPTS += --target=pe-x86-64
else ifeq ($(BUILD_ARM64),True)
RC = aarch64-w64-mingw32-windres
endif
else
CCOPTS += -fPIC
ifneq ($(BUILD_SOLARIS),True)
ifneq ($(BUILD_HAIKU),True)
CCOPTS += -pthread
endif
endif
ifdef GLOBALDLL
ifeq ($(BUILD_OSX),True)
LDOPTS += -Wl,-dylib_install_name,lib$(GLOBALDLL)-$(VERSION).$(REVISION)$(SHARED)
else
LDOPTS += -Wl,-soname,lib$(GLOBALDLL)-$(VERSION)$(SHARED).$(REVISION)
endif
endif
ifeq ($(BUILD_OPENBSD),True)
LDOPTS += -L/usr/X11R6/lib -L/usr/local/lib
endif
endif
ifndef GLOBALLIB
ifndef GLOBALEXE
ifndef GLOBALDLL
ifndef LOCALEXE
ifndef LOCALDLL
CCOPTS += -DSMOOTH_DLL
endif
endif
endif
endif
endif
.SUFFIXES: .mm .rc
TARGETS =
ifdef GLOBALLIB
TARGETS += $(SMOOTH_PATH)/$(LIBDIR)/$(GLOBALLIB)
endif
ifdef GLOBALEXE
TARGETS += $(SMOOTH_PATH)/$(BINDIR)/$(GLOBALEXE)$(EXECUTABLE)
endif
ifdef GLOBALDLL
ifeq ($(BUILD_WIN32),True)
TARGETS += $(SMOOTH_PATH)/$(BINDIR)/$(GLOBALDLL)$(SHARED)
TARGETS += $(SMOOTH_PATH)/$(LIBDIR)/$(IMPORTLIB)
else
TARGETS += $(SMOOTH_PATH)/$(LIBDIR)/lib$(GLOBALDLL)-$(VERSION)$(SHARED)
endif
endif
ifdef LOCALEXE
TARGETS += $(LOCALEXE)$(EXECUTABLE)
endif
ifdef LOCALDLL
TARGETS += $(LOCALDLL)$(SHARED)
ifeq ($(BUILD_WIN32),True)
TARGETS += $(IMPORTLIB)
endif
endif
all: allcmds $(OBJECTS) $(TARGETS)
allcmds:
+ $(ALLCMD1)
+ $(ALLCMD2)
+ $(ALLCMD3)
+ $(ALLCMD4)
clean:
ifdef OBJECTS
rm -f $(OBJECTS)
endif
ifdef TARGETS
rm -f $(TARGETS)
endif
$(CLEANCMD1)
$(CLEANCMD2)
$(CLEANCMD3)
$(CLEANCMD4)
.c.o:
$(CC) $(CCOPTS) $(CFLAGS) -c $< -o $@
.cc.o:
$(CXX) $(CCOPTS) $(CXXFLAGS) -c $< -o $@
.cpp.o:
$(CXX) $(CCOPTS) $(CXXFLAGS) -c $< -o $@
.m.o:
$(OBJC) $(CCOPTS) $(OBJCFLAGS) -c $< -o $@
.mm.o:
$(OBJCXX) $(CCOPTS) $(OBJCXXFLAGS) -c $< -o $@
.rc.o:
$(RC) $(RCOPTS) $< -o $@
ifdef GLOBALLIB
$(SMOOTH_PATH)/$(LIBDIR)/$(GLOBALLIB): $(OBJECTS)
mkdir -p $(SMOOTH_PATH)/$(LIBDIR)
$(AR) rs $@ $(OBJECTS)
endif
ifdef GLOBALEXE
$(SMOOTH_PATH)/$(BINDIR)/$(GLOBALEXE)$(EXECUTABLE): $(OBJECTS)
mkdir -p $(SMOOTH_PATH)/$(BINDIR)
$(LD) -o $@ $(OBJECTS) $(LDOPTS) $(LDFLAGS) $(LDFLAGS_TOOLS)
endif
ifdef GLOBALDLL
ifeq ($(BUILD_WIN32),True)
$(SMOOTH_PATH)/$(BINDIR)/$(GLOBALDLL)$(SHARED): $(OBJECTS)
mkdir -p $(SMOOTH_PATH)/$(BINDIR)
else
$(SMOOTH_PATH)/$(LIBDIR)/lib$(GLOBALDLL)-$(VERSION)$(SHARED): $(OBJECTS)
endif
mkdir -p $(SMOOTH_PATH)/$(LIBDIR)
ifneq ($(BUILD_OSX),True)
$(LD) --shared -o $@ $(OBJECTS) $(LDOPTS) $(LDFLAGS) $(LDFLAGS_TOOLS)
else
$(LD) -dynamiclib -o $@ $(OBJECTS) $(LDOPTS) $(LDFLAGS) $(LDFLAGS_TOOLS)
endif
ifeq ($(BUILD_WIN32),True)
$(SMOOTH_PATH)/$(LIBDIR)/$(IMPORTLIB): $(SMOOTH_PATH)/$(BINDIR)/$(GLOBALDLL)$(SHARED)
endif
endif
ifdef LOCALEXE
$(LOCALEXE)$(EXECUTABLE): $(OBJECTS)
$(LD) -o $@ $(OBJECTS) $(LDOPTS) $(LDFLAGS) $(LDFLAGS_TOOLS)
endif
ifdef LOCALDLL
$(LOCALDLL)$(SHARED): $(OBJECTS)
ifneq ($(BUILD_OSX),True)
$(LD) --shared -o $@ $(OBJECTS) $(LDOPTS) $(LDFLAGS) $(LDFLAGS_TOOLS)
else
$(LD) -dynamiclib -o $@ $(OBJECTS) $(LDOPTS) $(LDFLAGS) $(LDFLAGS_TOOLS)
endif
ifeq ($(BUILD_WIN32),True)
$(IMPORTLIB): $(LOCALDLL)$(SHARED)
endif
endif