forked from louisgt/SodaPop
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
57 lines (48 loc) · 1.65 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
RM =rm
CP =cp
CC =g++
IDIR =./include
CXXFLAGS =-std=c++11 -Wall -O3 -I$(IDIR)
LINK = $(CXX) $(CXXFLAGS)
COMPILE = $(CXX) $(LIBS) $(CXXFLAGS) $(LDFLAGS) $(LDLIBS) -c
SODAPOP = sodapop
SNAP2ASCII = sodasnap
SUMM2SNAP = sodasumm
INSTALLDIR = /usr/local/bin
all: $(SODAPOP) $(SNAP2ASCII) $(SUMM2SNAP)
install:
@echo \#\#\# Installing binaries to $(INSTALLDIR)/...
$(CP) $(SODAPOP) $(INSTALLDIR)/
$(CP) $(SNAP2ASCII) $(INSTALLDIR)/
$(CP) $(SUMM2SNAP) $(INSTALLDIR)/
uninstall:
@echo \#\#\# Uninstalling binaries from $(INSTALLDIR)/...
$(RM) -r $(INSTALLDIR)/$(SODAPOP)
$(RM) -r $(INSTALLDIR)/$(SNAP2ASCII)
$(RM) -r $(INSTALLDIR)/$(SUMM2SNAP)
# link
$(SODAPOP): sodapop.o rng.o global.o gene.o cell.o population.o
$(LINK) sodapop.o rng.o global.o gene.o cell.o population.o -o sodapop
$(SNAP2ASCII): snap2ascii.o
$(LINK) -o sodasnap snap2ascii.o rng.o global.o
$(SUMM2SNAP): summ2snap.o rng.o gene.o cell.o global.o
$(LINK) -o sodasumm summ2snap.o rng.o global.o gene.o cell.o
# compile different units
rng.o: ./src/rng.cpp
$(COMPILE) -o rng.o ./src/rng.cpp
global.o: ./src/global.cpp
$(COMPILE) -o global.o ./src/global.cpp
gene.o: ./src/Gene.cpp
$(COMPILE) -o gene.o ./src/Gene.cpp
cell.o: ./src/Cell.cpp
$(COMPILE) -o cell.o ./src/Cell.cpp
population.o: ./src/Population.cpp
$(COMPILE) -o population.o ./src/Population.cpp
sodapop.o: ./src/evolve.cpp
$(COMPILE) -o sodapop.o ./src/evolve.cpp
snap2ascii.o: ./tools/snap2ascii.cpp ./src/global.cpp
$(COMPILE) -o snap2ascii.o ./tools/snap2ascii.cpp
summ2snap.o: ./tools/summ2snap.cpp ./src/Cell.cpp
$(COMPILE) -o summ2snap.o ./tools/summ2snap.cpp
clean:
rm -f *.o