forked from yedf2/handy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
41 lines (27 loc) · 757 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
# OPT ?= -O2 -DNDEBUG
# (B) Debug mode, w/ full line-level debugging symbols
OPT ?= -g2
# (C) Profiling mode: opt, but w/debugging symbols
# OPT ?= -O2 -g2 -DNDEBUG
include ../config.mk
CFLAGS += -I.. $(PLATFORM_CCFLAGS) $(OPT)
CXXFLAGS += -I.. $(PLATFORM_CXXFLAGS) $(OPT)
LDFLAGS += $(PLATFORM_LDFLAGS)
LIBS += $(PLATFORM_LIBS)
SOURCES=proto_msg.cc test.cc
OBJS = $(SOURCES:.cc=.o)
PROGRAMS = test
default: $(PROGRAMS)
$(PROGRAMS): $(OBJS)
$(CXX) -o $@ $^ msg.pb.cc $(LDFLAGS) `pkg-config --libs protobuf` -lhandy
$(OBJS): middle
middle: msg.proto
protoc --cpp_out=. $<
@touch $@
clean:
-rm -f $(PROGRAMS) middle
-rm -f *.o *.pb.*
.cc.o:
$(CXX) $(CXXFLAGS) -c $< -o $@ `pkg-config --cflags protobuf`
.c.o:
$(CC) $(CFLAGS) -c $< -o $@