-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
37 lines (28 loc) · 778 Bytes
/
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
CPPC:=g++
INCFLAGS:= -I. $(shell pkg-config --cflags gtkmm-3.0)
CPPFLAGS:= -c -Wall -std=c++0x -O3 -ffast-math $(INCFLAGS) -ggdb
LD:=g++
LDFLAGS:= -lGL -lSDL -lGLU -O3 -ffast-math $(shell pkg-config --libs gtkmm-3.0)
MMFLAGS:= $(INCFLAGS)
BINDIR:=bin
CPPSRCFILES:=$(shell find -mindepth 0 -maxdepth 3 -name "*.cpp")
OBJFILES:=$(patsubst %.cpp, $(BINDIR)/%.o, $(CPPSRCFILES))
DEPS:=$(OBJFILES:.o=.d)
.PHONY: all
all: tgwave
@echo "Build successfull"
.PHONY: test
test: all
./tgwave
-include $(DEPS)
tgwave: $(OBJFILES)
$(LD) -o $@ $^ $(LDFLAGS)
$(BINDIR)/%.o: %.cpp Makefile
$(CPPC) $(CPPFLAGS) -o $@ $<
$(CPPC) -MM -MT $@ $(MMFLAGS) $< > $(BINDIR)/$*.d
.PHONY: clean
clean:
-@ rm -f tgwave
-@ rm -f gmon.out
-@ find $(BINDIR) -type f | xargs -- rm -f
run: test