-
Notifications
You must be signed in to change notification settings - Fork 142
/
Makefile
41 lines (29 loc) · 1.04 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
CXX = g++
CFLAGS = -Wall
CPPFLAGS = $(CFLAGS) -Irabbitmq-c/librabbitmq -I/usr/local/include -Lrabbitmq-c/build/librabbitmq -L/usr/local/lib -Iinclude/
LIBRARIES= rabbitmq ssl crypto
LIBS = $(addprefix -l,$(LIBRARIES))
LIBNAME = amqpcpp
LIBFILE = lib$(LIBNAME).a
LIBSO = lib$(LIBNAME).so
SOURCES = src/AMQP.cpp src/AMQPBase.cpp src/AMQPException.cpp src/AMQPMessage.cpp src/AMQPExchange.cpp src/AMQPQueue.cpp
EXFILES = example_publish.cpp example_consume.cpp example_get.cpp
EXAMPLES = $(EXFILES:.cpp=)
OBJECTS = $(SOURCES:.cpp=.o)
all: lib $(EXAMPLES)
lib: $(LIBFILE) $(LIBSO)
$(LIBFILE): $(OBJECTS)
$(AR) rcs $@ $(OBJECTS)
$(LIBSO): $(OBJECTS)
$(CXX) $(CPPFLAGS) -fPIC -shared $(SOURCES) -o $(LIBSO)
$(EXAMPLES): $(addprefix examples/,$(EXFILES)) $(LIBFILE)
$(CXX) $(CPPFLAGS) -o $@ examples/[email protected] $(LIBFILE) $(LIBS)
install:
cp $(LIBSO) /usr/local/lib
ldconfig
cp include/* /usr/local/include/
uninstall:
rm /usr/local/lib/$(LIBSO)
rm /usr/local/include/AMQPcpp.h
clean:
rm -f $(OBJECTS) $(EXAMPLES) $(LIBFILE) $(LIBSO)