-
Notifications
You must be signed in to change notification settings - Fork 1
/
makefile
53 lines (37 loc) · 1.1 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
IDIR =./include
INDIR =./lib
CC=g++
CFLAGS=-I$(IDIR) -I$(INDIR)
GTKFLAG = `pkg-config gtkmm-3.0 --cflags --libs`
ODIR =./bin/source
OGDIR=./bin/gui
LDIR =./lib
SDIR =./src
BDIR =./build
TDIR = ./test
LIBS=-lm
_DEPS = Classes.h
DEPS = $(patsubst %,$(IDIR)/%,$(_DEPS))
_GDEPS = Classes.h gui.h
GDEPS = $(patsubst %,$(IDIR)/%,$(_GDEPS))
_OBJ = Point.o Object3D.o Projection2D.o OrthoProjection.o PlaneProjection.o Wireframe.o
OBJ = $(patsubst %,$(ODIR)/%,$(_OBJ))
_GOBJ = Main.o Maingui.o Projectgui.o Constructgui.o
GOBJ = $(patsubst %,$(OGDIR)/%,$(_GOBJ))
_BUILDS = main
BUILDS = $(patsubst %,$(BDIR)/%,$(_BUILDS))
TESTS = $(patsubst %,$(TDIR)/%,$(_BUILDS))
MKDIR = mkdir -p
OUT_DIR = bin/gui bin/source build
$(ODIR)/%.o: $(SDIR)/%.cpp $(DEPS)
$(CC) -c -o $@ $< $(CFLAGS) $(GTKFLAG)
$(OGDIR)/%.o: $(SDIR)/%.cpp $(GDEPS)
$(CC) -c -o $@ $< $(CFLAGS) $(GTKFLAG)
all: directories $(BUILDS) $(TESTS)
test: directories $(TESTS)
directories:
$(MKDIR) $(OUT_DIR)
$(BDIR)/main: $(OBJ) $(GOBJ)
$(CC) -o $@ $^ $(CFLAGS) $(GTKFLAG) $(LIBS)
$(TDIR)/main: $(OBJ) $(GOBJ)
$(CC) -o $@ $^ $(CFLAGS) $(GTKFLAG) $(LIBS)