forked from fvictorio/ic_som
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmakefile
55 lines (37 loc) · 1.2 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
CXX = g++
CPPFLAGS = -Wall -pedantic-errors -ggdb
LIBRARIES_grapher = $(addprefix -l,GL GLU glut)
LIBRARIES_som =
object_som = $(addprefix obj/,main.o neurona_som.o som.o util.o neurona.o)
object_grapher = $(addprefix obj/,grapher.o)
object_input = $(addprefix obj/,input.o util.o)
objects = $(object_som) $(object_grapher) $(object_input)
binaries = $(addprefix bin/,som grapher input)
project: $(binaries)
all: $(objects)
bin/som: $(object_som)
$(CXX) $(LIBRARIES_som) $(object_som) -o $@
bin/grapher: $(object_grapher)
$(CXX) $(LIBRARIES_grapher) $(object_grapher) -o $@
bin/input: $(object_input)
$(CXX) $(object_input) -o $@
obj/input.o: $(addprefix header/,util.h)
obj/main.o: $(addprefix header/,som.h neurona_som.h)
obj/neurona.o: $(addprefix header/,util.h neurona.h)
obj/neurona_som.o: $(addprefix header/,util.h neurona_som.h)
obj/som.o: $(addprefix header/,som.h neurona_som.h util.h)
obj/util.o: $(addprefix header/,util.h)
obj/%.o : src/%.cpp
$(CXX) $< -c $(CPPFLAGS) -Iheader -o $@
obj/main.o: src/main.cpp
$(CXX) $< -c $(CPPFLAGS) -Iheader -o $@
$(objects): | obj
$(binaries): | bin
obj:
mkdir $@
bin:
mkdir $@
.PHONY: clean test
clean:
-rm $(objects) $(binaries)
-rmdir bin obj