-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
54 lines (38 loc) · 1.16 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
include config.mak
#MAKE = gmake
SRCDIR = src
BINDIR = bin
TARGET = bin/birdFountain
INCDIR = inc
#LDFLAGS=$(LDFLAGS) -lTomFun -llinAlg -lglut -lGLU -lGL -L/usr/lib/x86_64-linux-gnu/ #-lMagick++-6.Q16 -lMagick++
GTESTFLAGS=-lgtest_main -lgtest -lpthread -lg
CCFILES1 = $(wildcard $(SRCDIR)/*/*.cc) $(wildcard $(SRCDIR)/*/*/*.cc) $(wildcard $(SRCDIR)/*/*/*/*.cc)
TESTFILES = $(filter-out %Main.cc,$(CCFILES1))
TESTOBJS = $(TESTFILES:.cc=.o)
CCFILES = $(filter-out %Test.cc,$(CCFILES1))
#CCFILES = $(FUNCCS)
OBJS = $(CCFILES:.cc=.o)
INCLDIRS = -I$(SRCDIR) -I$(INCDIR) $(addprefix -I,$(dir $(CCFILES)))
#CC = g++
#build
$(TARGET): $(OBJS)
mkdir -p $(dir $(TARGET))
$(CC) $(CCFLAGS) -o $(TARGET) $(OBJS) $(LDFLAGS)
chmod 755 $@
#Remember to run make install with permissions on $(prefix)
.cc.o:
$(CC) $(CCFLAGS) -c -o $@ $^ $(INCLDIRS)
# install
install: $(TARGET)
cp $(TARGET) $(prefix)/bin/
all: config.mak $(OBJS) $(TARGET)
copyheaders:
cp $(SRCDIR)/*/*.h $(prefix)/include
mrproper: clean
rm -f config.h config.mak
clean:
rm -f $(TARGET)
rm -f $(OBJS) $(TESTOBJS)
test: $(TESTOBJS)
$(CC) $(CCFLAGS) $(TESTOBJS) -o bin/test $(LDFLAGS) $(GTESTFLAGS)
bin/test