-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
executable file
·121 lines (94 loc) · 3.69 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
#/***************************************************************************************************
#* Copyright (c) 2018 Artois University
#* Copyright (c) 2018 Côte d'Azur University
#*
#* This file is part of Tree-Width Abstractions
#*
#* Tree-Width Abstractions is free software: you can redistribute it and/or modify it
#* under the terms of the GNU General Public License as published by the Free Software Foundation,
#* either version 3 of the License, or (at your option) any later version.
#*
#* Tree-Width Abstractions is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
#* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
#* See the GNU General Public License for more details.
#*
#* You should have received a copy of the GNU General Public License along with Tree-Width Abstractions.
#* If not, see http://www.gnu.org/licenses/.
#*
#* Authors:
#* - Valentin Montmirail (montmirail@cril.fr)
#* - Marie Pelleau (marie.pelleau@unice.fr)
#* - Jean-Marie Lagniez (lagniez@cril.fr)
#* Contributors:
#* - Valentin Montmirail (montmirail@cril.fr)
#***************************************************************************************************/
# compiler :
COMPILER = g++
LPROFILAGE = -fprofile-arcs -ftest-coverage -fPIC -O0
COPTIONS = -O3 -Wall -Wextra -Wno-unused-parameter -std=c++11
COPTIONS_DEBUG = -pg -g -Wall -Wextra -Wno-unused-parameter -std=c++11 $(LPROFILAGE)
LOPTIONS += -static -lboost_system
UNAME_S := $(shell uname -s)
EXECUTABLE = graphcoloring
# -------------------------------------------------------------------
# Emplacement des sources et des objets, des includes et de l'executable
# -------------------------------------------------------------------
# path:
CODE = $(shell pwd)
# folder for the executable
EXEDIR = $(CODE)/bin
DEBUGDIR = $(CODE)/debug
# adress of the source code, objects and include files:
SRCDIR = $(CODE)
OBJDIR = $(CODE)/obj
# create the list of file sources:
SRC = $(wildcard $(SRCDIR)/*.cc)
# list the files:
NOM = $(basename $(notdir $(SRC)))
OBJ = $(addprefix $(OBJDIR)/, $(addsuffix .o, $(NOM)))
OBJ_DEBUG = $(addprefix $(OBJDIR)/, $(addsuffix .od, $(NOM)))
.PHONY: help
release: faire_dossier $(OBJ)
$(COMPILER) -o $(EXEDIR)/$(EXECUTABLE) $(OBJ)
debug: faire_dossier $(OBJ_DEBUG)
$(COMPILER) -o $(DEBUGDIR)/$(EXECUTABLE) $(LPROFILAGE) $(OBJ_DEBUG)
# link edition
install: faire_dossier release
make release
# rules to do the folders
faire_dossier: makedir
@echo "folders created"
# compilation rules
$(OBJDIR)/%.o: $(SRCDIR)/%.cc $(SRCDIR)/%.h
$(COMPILER) -c $(COPTIONS) -o $@ $<
$(OBJDIR)/%.od: $(SRCDIR)/%.cc $(SRCDIR)/%.h
$(COMPILER) -c $(COPTIONS_DEBUG) -o $@ $<
all: release
make release
# -------------------------------------------------------------------
# to create the objects folder
# -------------------------------------------------------------------
# creation of the folder $(OBJDIR) if it is necessary:
makedir:
mkdir -p $(OBJDIR)
mkdir -p $(EXEDIR)
mkdir -p $(DEBUGDIR)
# -------------------------------------------------------------------
# cleaning rules
# -------------------------------------------------------------------
.PHONY: clean purge
clean:
@rm -rf $(OBJDIR)
@rm -rf $(EXEDIR)
@rm -rf $(DEBUGDIR)
@rm -rf *~
help:
@echo "--------------------------------------------------------------------------"
@echo " Disponible rules"
@echo
@echo " install : compilation and executable creation"
@echo " clean : remove the object files"
@echo " purge : remove the object files and the executable"
@echo " help : print this comments (defautl)"
@echo "--------------------------------------------------------------------------"
@echo