-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
38 lines (29 loc) · 801 Bytes
/
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
CXX = g++-4.8
CXXFLAGS = -std=c++11 -O3 -Wall -Wextra -Wshadow -Werror -pedantic
ifeq ($(DEBUG), 1)
CXXFLAGS += -g3 -DDEBUG
else
CXXFLAGS += -DNDEBUG
endif
HEADERFILES = sstring.hpp \
word_maps.hpp
%.o: %.cpp $(HEADERFILES)
@echo 'Compiling $<'
@$(CXX) $(CXXFLAGS) -c $< -o $@
all: compressor concat compare substr
compressor: compressor.o sstring.o word_maps.o
@echo 'Linking $<'
@$(CXX) -o compressor $^ $(LDFLAGS)
concat: concat.o sstring.o word_maps.o
@echo 'Linking $<'
@$(CXX) -o concat $^ $(LDFLAGS)
compare: compare.o sstring.o word_maps.o
@echo 'Linking $<'
@$(CXX) -o compare $^ $(LDFLAGS)
substr: substr.o sstring.o word_maps.o
@echo 'Linking $<'
@$(CXX) -o substr $^ $(LDFLAGS)
.PHONY: clean
clean:
@echo 'Removing object files and executable'
@rm -rf *.o main