-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
59 lines (44 loc) · 1.39 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
CC=g++
OBJDIR=./obj
BINDIR=./bin
LIBS=-ldl -pthread
DIRS=-I.
CFLAGS=-std=c++0x -g
#############################
# Binary Config
#############################
SERVER_OBJ_LIST=imageFactory.o comicFrames.o frameDetect.o lodepng.o receiver.o sender.o worker.o main.o imagePreprocessor.o queue.o
SERVER_OBJ=$(patsubst %, $(OBJDIR)/%, $(SERVER_OBJ_LIST))
SERVER_DEPS=
SERVER_BIN=server
# This is just my secret target for doing quick and dirty tests
TEST_OBJ_LIST=lodepng.o test.o imageFactory.o imagePreprocessor.o frameDetect.o comicFrames.o
TEST_OBJ=$(patsubst %, $(OBJDIR)/%, $(TEST_OBJ_LIST))
TEST_DEPS=zipdep/ioapi.o zipdep/unzip.o zipdep/libz.a
TEST_BIN=test
#############################
# Binary Targets
#############################
all: $(SERVER_BIN)
$(SERVER_BIN): $(SERVER_OBJ) $(SERVER_DEPS)
$(CC) -o $(BINDIR)/$@ $^ $(CFLAGS) $(LIBS) $(DIRS)
$(TEST_BIN): $(TEST_OBJ) $(TEST_DEPS)
$(CC) -o $(BINDIR)/$@ $^ $(CFLAGS) $(LIBS) $(DIRS)
#############################
# Rules for building .o
#############################
$(OBJDIR)/%.o: %.cpp $(TEST_DEPS) folders
$(CC) -c -o $@ $< $(CFLAGS) $(LIBS)
$(OBJDIR)/lodepng.o: lodepng/lodepng.cpp folders
$(CC) -c -o $@ $< $(CFLAGS) $(LIBS)
#############################
# Phony Targets
#############################
.PHONY: clean lightclean folders
folders:
@mkdir -p $(OBJDIR)
@mkdir -p $(BINDIR)
lightclean:
rm -rf *.gch
clean:
rm -rf bin/* obj/* *.gch