-
Notifications
You must be signed in to change notification settings - Fork 12
/
Makefile.osx
59 lines (41 loc) · 1.66 KB
/
Makefile.osx
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
include Makefile.srcs
CC = gcc
CXX = g++
AR = ar
CXXFLAGS = -O2 -arch x86_64 -mmacosx-version-min=10.11
LDFLAGS = -arch x86_64 -lstdc++ -mmacosx-version-min=10.11
PLATFORM = OSXx64
COMMON_MODULES = $(COMMON_SRCS:.c=.o)
COMMON_MODULES := $(COMMON_MODULES:.cpp=.o)
TESTSERVER_MODULES = $(TESTSERVER_SRCS:.c=.o)
TESTSERVER_MODULES := $(TESTSERVER_SRCS:.cpp=.o)
TESTSERVER_TARGET= Build/$(PLATFORM)/TestServer
P4PLUGIN_MODULES = $(P4PLUGIN_SRCS:.c=.o)
P4PLUGIN_MODULES := $(P4PLUGIN_MODULES:.cpp=.o)
P4PLUGIN_TARGET = PerforcePlugin
OSX_SRCS = ./P4Plugin/Source/P4OSX.mm
OSX_MODULES = $(OSX_SRCS:.mm=.o)
P4PLUGIN_MODULES += $(OSX_MODULES)
default: all
all: P4Plugin testserver
@mkdir -p Build/$(PLATFORM)
testserver: $(TESTSERVER_TARGET)
@mkdir -p Build/$(PLATFORM)
P4Plugin: $(P4PLUGIN_TARGET)
@mkdir -p Build/$(PLATFORM)
cp $(P4PLUGIN_TARGET) Build/$(PLATFORM)
Common: $(COMMON_MODULES)
Common/%.o : Common/%.cpp $(COMMON_INCLS)
$(CXX) $(CXXFLAGS) $(INCLUDE) -c $< -o $@
Test/Source/%.o : Test/Source/%.cpp $(TESTSERVER_INCLS)
$(CXX) $(CXXFLAGS) $(TESTSERVER_INCLUDE) -c $< -o $@
P4Plugin/Source/%.o : P4Plugin/Source/%.cpp $(COMMON_INCLS) $(P4PLUGIN_INCLS)
$(CXX) $(CXXFLAGS) $(P4PLUGIN_INCLUDE) -D_MACOS -c $< -o $@
P4Plugin/Source/%.o : P4Plugin/Source/%.mm $(COMMON_INCLS) $(P4PLUGIN_INCLS)
$(CXX) $(CXXFLAGS) $(P4PLUGIN_INCLUDE) -c $< -o $@
$(TESTSERVER_TARGET): $(COMMON_MODULES) $(TESTSERVER_MODULES)
$(CXX) -g $(LDFLAGS) -o $@ $^
$(P4PLUGIN_TARGET): $(COMMON_MODULES) $(P4PLUGIN_MODULES)
$(CXX) $(LDFLAGS) -o $@ -framework Cocoa $^ -L./P4Plugin/Source/r19.1/lib/osx64 $(P4PLUGIN_LINK)
clean:
rm -f Build/*.* $(COMMON_MODULES) $(P4PLUGIN_MODULES) $(TESTSERVER_MODULES)