-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.cmq
63 lines (39 loc) · 1.16 KB
/
Makefile.cmq
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
PREFIX=.
BIN=testczmq
LIBPATH=
INCLUDE_PATH=
THIRD_PARTY_PATH=../o2oserver/third_party/Linux
GLIB_PATH=$(THIRD_PARTY_PATH)
EVENT_PATH=/home/zhangjun-s/opt
CZMQ_PATH=$(THIRD_PARTY_PATH)
GLIB_CFLAGS=-I$(GLIB_PATH)/include/glib-2.0 -I$(GLIB_PATH)/lib/glib-2.0/include
GLIB_LIBS=-L$(GLIB_PATH)/lib -lglib-2.0
GTHREAD_LIBS=-pthread -lgthread-2.0 -lrt
EVENT_LIBS=-L$(EVENT_PATH)/lib -levent
EVENT_CFLAGS=-I$(EVENT_PATH)/include
CZMQ_LIBS=-L$(CZMQ_PATH)/lib -lczmq
CZMQ_CFLAGS=-I$(CZMQ_PATH)/include
LIBS:=$(GLIB_LIBS) $(GTHREAD_LIBS) $(EVENT_LIBS) $(CZMQ_LIBS)
INCLUDE=$(GLIB_CFLAGS) $(EVENT_CFLAGS) $(CZMQ_CFLAGS)
CFLAGS= -std=gnu99 -g -Wall $(INCLUDE)
INSTALL=/usr/bin/install -c
LDFLAGS= -Wl,-R$(THIRD_PARTY_PATH)/lib -Wl,-R$(EVENT_PATH)/lib
CC=gcc
SOURCE=testczmq.c
OBJS:=$(patsubst %.c, %.o, $(SOURCE))
DEPS:=$(patsubst %.o, %.d, $(OBJS))
CPPFLAGS += -MMD
.PHONY: all deps objs clean
all: $(BIN)
deps: $(DEPS)
objs: $(OJBS)
-include $(DEPS)
$(BIN): $(OBJS)
$(CC) $(LDFLAGS) -o $(BIN) $(OBJS) $(LIBS)
clean:
@$(RM) $(OBJS) $(DEPS) $(BIN)
test:
./$(BIN)
install:
if test ! -d $(PREFIX)/bin;then mkdir -p $(PREFIX)/bin;fi
$(INSTALL) $(BIN) $(PREFIX)/bin/