-
Notifications
You must be signed in to change notification settings - Fork 5
/
Makefile
72 lines (55 loc) · 1.94 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
INCLUDE_DIR =
LIBRARY_DIR =
LDFLAGS = -L.
LDLIBS = -lMPW -lpthread
CXXFLAGS = -O3 -Wall -fPIC
TARGET_ARCH = #-arch i386
INSTALL_PREFIX = .
Test_objects = tests/Test.o
UnitTests_objects = tests/UnitTests.o
TestConcurrent_objects = tests/TestConcurrent.o
Amuse_objects = amuse/AmuseAgent.o
TestRestart_objects = tests/TestRestart.o
dg_objects = DataGather.o
fw_objects = Forwarder.o
wcp_objects = mpw-cp.o
# OS X
#SO_EXT = dylib
#SHARED_LINK_FLAGS = -dynamiclib
# Linux
SO_EXT = so
SHARED_LINK_FLAGS = -shared
all : MPWUnitTests MPWTest MPWTestConcurrent MPWDataGather MPWForwarder MPWFileCopy libMPW.a libMPW.$(SO_EXT)
install: libMPW.a libMPW.$(SO_EXT) MPWForwarder
mkdir -p $(INSTALL_PREFIX)/lib
mkdir -p $(INSTALL_PREFIX)/bin
mkdir -p $(INSTALL_PREFIX)/include
cp libMPW.$(SO_EXT)* $(INSTALL_PREFIX)/lib/
cp libMPW.a $(INSTALL_PREFIX)/lib/
cp MPWForwarder $(INSTALL_PREFIX)/bin/
cp MPWide.h $(INSTALL_PREFIX)/include/
libMPW.a: MPWide.o Socket.o
$(AR) $(ARFLAGS) $@ $^
libMPW.$(SO_EXT): MPWide.o Socket.o
$(CXX) $(CXXFLAGS) $(SHARED_LINK_FLAGS) $(TARGET_ARCH) -dynamiclib -o $@ $^
# ld -shared -soname libMPW.so.1 -o libMPW.so.1.0 -lc MPWide.o Socket.o
LINK_EXE = $(CXX) $(LDFLAGS) $(TARGET_ARCH) $< $(LOADLIBES) $(LDLIBS) -o $@
MPWUnitTests: $(UnitTests_objects) libMPW.a
$(LINK_EXE)
MPWTest: $(Test_objects) libMPW.a
$(LINK_EXE)
MPWTestConcurrent: $(TestConcurrent_objects) libMPW.a
$(LINK_EXE)
MPWAmuseAgent: $(Amuse_objects) libMPW.a
$(LINK_EXE)
MPWForwarder: $(fw_objects) libMPW.a
$(LINK_EXE)
MPWDataGather: $(dg_objects) libMPW.a
$(LINK_EXE)
MPWFileCopy: $(wcp_objects) libMPW.a
$(LINK_EXE)
Test: tests/Test.cpp
TestConcurrent: tests/TestConcurrent.cpp
Forwarder: Forwarder.cpp
clean:
rm -f *.o MPWUnitTests MPWTest MPWTestConcurrent MPWDataGather MPWForwarder MPWAmuseAgent MPWFileCopy libMPW.a libMPW.$(SO_EXT)* bin lib include tests/*.o