-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
66 lines (52 loc) · 1.27 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
# Makefile for the ELIS project
# Authors:
# Felipe Ramos
# Daniel Guerra
#
# Makefile conventions
SHELL = /bin/sh
# Directories
INCDIR = ./include
SRCDIR = ./src
OBJDIR = ./obj
BINDIR = ./bin
DATADIR = ./data
# DOCDIR = ./Documentation
# Macros
CC = g++
CFLAGS = -Wall -w -g -ggdb -std=c++11 -I. -I$(INCDIR) -lncurses
RM = -rm
PROJ_NAME = elis
# DOC_NAME = index.html
HEADERS := $(wildcard $(INCDIR)/*)
SOURCES := $(wildcard $(SRCDIR)/*.cpp)
OBJECTS := $(SOURCES:$(SRCDIR)/%.cpp=$(OBJDIR)/%.o)
all: project
project: $(OBJECTS) $(HEADERS) | $(BINDIR)
$(CC) $(OBJECTS) $(CFLAGS) -o $(BINDIR)/$(PROJ_NAME)
@ln -sfv $(BINDIR)/$(PROJ_NAME) $(PROJ_NAME)
docs:
@mkdir -p $(DOCDIR)
@doxygen config
@ln -sfv $(DOCDIR)/html/index.html $(DOC_NAME)
$(OBJECTS): $(OBJDIR)/%.o : $(SRCDIR)/%.cpp $(HEADERS) | $(OBJDIR)
$(CC) $(CFLAGS) -c $< -o $@
$(OBJDIR):
@mkdir -p $(OBJDIR)
$(BINDIR):
@mkdir -p $(BINDIR)
# Clean PHONY targets
.PRONY: clean clean_proj clean_doc
clean: clean_proj clean_doc
clean_proj:
@echo "Removing OBJDIR..."
@$(RM) -r $(OBJDIR)
@echo "Removing BINDIR..."
@$(RM) -r $(BINDIR)
@echo "Removing symlink..."
@$(RM) -f $(PROJ_NAME)
@echo "Clean-up completed!"
clean_doc:
@echo "Removing documentation files..."
@$(RM) -r Documentation/
@$(RM) -f $(DOC_NAME)