-
Notifications
You must be signed in to change notification settings - Fork 17
/
Makefile
55 lines (40 loc) · 1.34 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
#CXXFLAGS = -O3 -Wall -fmessage-length=0 -std=c++11
CXXFLAGS = -fPIC -g -O3 -Wall -fmessage-length=0 -std=c++11
CFLAGS = -Wno-address -Wno-char-subscripts # -Wno-sign-compare
SWIFT=$(wildcard src/*.cpp)
LIBSWIFTHEADERS=$(wildcard src/*.h)
TEST=test.cpp
CXXSOURCES=$(SWIFT)
TESTSOURCES=$(TEST)
#CSOURCES=httpxx/http_parser.c
CXXOBJS=$(CXXSOURCES:%.cpp=%.o)
TESTOBJS=$(TESTSOURCES:%.cpp=%.o)
#COBJS=$(CSOURCES:%.c=%.o)
#build dir
BUILDDIR=build
#Libraries
LDFLAGS = -shared
LIBS =-lPocoUtild -lPocoUtil -lPocoXML -lPocoNet -lPocoNetd -lPocoFoundation -lPocoXMLd -lPocoFoundationd -lpthread
TARGET = SwiftSDK
LIBSWIFT = $(BUILDDIR)/libSwift.so
#CXX=clang++
all: $(LIBSWIFT) $(TARGET)
$(LIBSWIFT) : $(CXXOBJS)
mkdir -p $(BUILDDIR)
mkdir -p $(BUILDDIR)/include/Swift
$(CXX) $(CXXFLAGS) $(CXXOBJS) -o $@ $(LDFLAGS) $(LIBS)
cp -rf $(LIBSWIFTHEADERS) $(BUILDDIR)/include/Swift
$(TARGET): $(CXXOBJS) $(COBJS) $(TESTOBJS)
# $(CXX) -o $(TARGET) $(CXXOBJS) $(LIBS) $(COBJS)
$(CXX) $(CXXFLAGS) -o $(TARGET) $(CXXOBJS) $(TESTOBJS) $(LIBS)
install:
cp -r $(BUILDDIR)/include/Swift /usr/local/include
cp $(LIBSWIFT) /usr/local/lib
uninstall:
rm -rf /usr/local/include/Swift
rm -f /usr/local/lib/libSwift.so
ldconfig
#$(COBJS): %.o: %.c
# $(CC) $(CFLAGS) -c $< -o $@
clean:
rm -rf $(CXXOBJS) $(TARGET) $(TESTOBJS) $(LIBSWIFT) $(wildcard build/*) $(BUILDDIR)