-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathMakefile
49 lines (41 loc) · 1.72 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
#
# Makefile for Asterisk discovery consul resource
# Copyright (C) 2015, Sylvain Boily
#
# This program is free software, distributed under the terms of
# the GNU General Public License Version 3. See the COPYING file
# at the top of the source tree.
#
INSTALL = install
ASTETCDIR = $(INSTALL_PREFIX)/etc/asterisk
SAMPLENAME = res_discovery_consul.conf.sample
CONFNAME = $(basename $(SAMPLENAME))
TARGET = res_discovery_consul.so
OBJECTS = res_discovery_consul.o
CFLAGS += -Wall -Wextra -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Winit-self -Wmissing-format-attribute \
-Wformat=2 -g -fPIC -D_GNU_SOURCE -D'AST_MODULE="res_discovery_consul"' -D'AST_MODULE_SELF_SYM=__internal_res_discovery_consul_self'
LIBS += -lcurl
LDFLAGS += -Wall -shared
.PHONY: install clean
$(TARGET): $(OBJECTS)
$(CC) $(LDFLAGS) $(OBJECTS) -o $@ $(LIBS)
%.o: %.c $(HEADERS)
$(CC) -c $(CFLAGS) -o $@ $<
install: $(TARGET)
mkdir -p $(DESTDIR)/usr/lib/asterisk/modules
install -m 644 $(TARGET) $(DESTDIR)/usr/lib/asterisk/modules/
@echo " +----- res_discovery_consul installed ------+"
@echo " + +"
@echo " + res_discovery_consul has successfully +"
@echo " + been installed. +"
@echo " + If you would like to install the sample +"
@echo " + configuration file run: +"
@echo " + +"
@echo " + make samples +"
@echo " +-------------------------------------------+"
clean:
rm -f $(OBJECTS)
rm -f $(TARGET)
samples:
$(INSTALL) -m 644 $(SAMPLENAME) $(DESTDIR)$(ASTETCDIR)/$(CONFNAME)
@echo " ------- res_discovery_consul config installed ---------"