-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
40 lines (29 loc) · 965 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
39
40
# Tool invocations
CC=g++
SRC=src
CFLAGS=-I$(SRC) -std=c++11 -O3 -Wall -fmessage-length=0
ODIR=Release
LIBS=-lpthread
_OBJS = BasicHTTP CmdLine Config DataHandler DataHandler/Exec DataHandler/Static Logger LoggingSingleton Manager Router SignalHandler Worker
OBJ = $(patsubst %,$(ODIR)/%.o,$(_OBJS))
hackttp: $(OBJ) $(ODIR)/server.o
@echo 'Building HackTTP: $@'
@$(CC) -o $@ $^ $(CFLAGS) $(LIBS)
$(ODIR)/DataHandler/%.o: $(SRC)/DataHandler/%.cpp $(SRC)/DataHandler.h $(ODIR)/.empty
@echo 'Building object: $@'
@$(CC) -c -o $@ $< $(CFLAGS)
$(ODIR)/%.o: $(SRC)/%.cpp $(SRC)/%.h $(ODIR)/.empty
@echo 'Building object: $@'
@$(CC) -c -o $@ $< $(CFLAGS)
$(ODIR)/server.o: $(SRC)/server.cpp
@echo 'Building object: $@'
@$(CC) -c -o $@ $< $(CFLAGS)
$(ODIR)/.empty:
@echo 'Creating $(ODIR) directory'
@mkdir -p $(ODIR)/DataHandler
@touch $(ODIR)/.empty
all: hackttp
clean:
@echo 'Removing: hackttp $(ODIR)'
@rm -rf hackttp $(ODIR)
.PHONY: all clean