This repository was archived by the owner on Sep 22, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
63 lines (50 loc) · 1.47 KB
/
Makefile
File metadata and controls
63 lines (50 loc) · 1.47 KB
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
58
59
60
61
62
CC=g++ -Werror
TESTADOR=bin/PNPNTest
SIMULATOR=bin/PNPNeuron
CONFIG_FILE=config/defaults.cfg config/physics_constants.cfg config/output.cfg
OBJETOS=src/RenderView.o src/Standarts.o src/main.o src/ModelLoad.o src/MainEngine.o src/Membrana.o src/EletricPotentialComputer.o src/GradientComputer.o src/Config.o
TEST_OBJ=src/mainTest.o
LD_FLAGS=-lSDL -lSDL_image -lpng -lz -lGL -lm
STRIP=strip
RUN=
ifdef debug
CC_FLAGS = -gstabs+ -ggdb
RUN=gdb
CONFIG_FILE=
STRIP=du -h
else
CC_FLAGS = -Ofast -pipe -mtune=native -march=native -mfpmath=both -msse -msse2 -msse3 -msse4.1 -msse4.2 -m3dnow -mmmx
RUN=time
endif
ifdef profile
CC_FLAGS = -ggdb -gstabs+ -pg
STRIP=du -h
endif
ifdef test
TESTDEFINE= -D__TEST__
endif
DEFINES = $(TESTDEFINE)
all: clean $(TESTADOR) $(SIMULATOR) run
clean: cleandocs
rm -rf src/*.o $(SIMULATOR) $(TESTADOR) gmon.out results src/*~ config/*~ log.txt
run:
@printf "running app\n"
@mkdir results
$(RUN) ./$(SIMULATOR) $(CONFIG_FILE)
@printf "\n\n\tapp end\n"
%.o:%.cpp
$(CC) -I. $(CC_FLAGS) -c $+ $(DEFINES) -o $@
docs:
doxygen src/doxy.template
cleandocs:
rm -rf html
$(SIMULATOR): $(OBJETOS)
@printf "Building application\n"
$(CC) $(CC_FLAGS) $(OBJETOS) "bin/libmgl.a" -o $(SIMULATOR) $(LD_FLAGS)
$(STRIP) $(SIMULATOR)
@printf "All build done\n\n"
$(TESTADOR): $(TEST_OBJ)
@printf "Testig source code...\n"
$(CC) $(CC_FLAGS) $(TEST_OBJ) -o $(TESTADOR) $(LD_FLAGS)
./$(TESTADOR)
@printf "Test passed sucessfull\n\n\n\n"