|
|
|
#
|
|
|
|
# _____ _ _ _____
|
|
|
|
# / ____(_) | | |_ _|
|
|
|
|
# | (___ _ _ __ ___ _ __ | | ___ ___ | | _ __
|
|
|
|
# \___ \| | '_ ` _ \| '_ \| |/ _ \/ __| | | | '_ \
|
|
|
|
# ____) | | | | | | | |_) | | __/\__ \ _| |_| |_) |
|
|
|
|
# |_____/|_|_| |_| |_| .__/|_|\___||___/ |_____| .__/
|
|
|
|
# | \/ | | | | |
|
|
|
|
# | \ / | __ _ _ __ |_|_ _ __ _ ___ _ __ |_|
|
|
|
|
# | |\/| |/ _` | '_ \ / _` |/ _` |/ _ \ '__|
|
|
|
|
# | | | | (_| | | | | (_| | (_| | __/ |
|
|
|
|
# |_| |_|\__,_|_| |_|\__,_|\__, |\___|_|
|
|
|
|
# __/ |
|
|
|
|
# |___/
|
|
|
|
#
|
|
|
|
# copyright 2022
|
|
|
|
#
|
|
|
|
# Compilar client manager Simples IP
|
|
|
|
#
|
|
|
|
|
|
|
|
CC=gcc
|
|
|
|
|
|
|
|
DIR_OBJ=build/
|
|
|
|
DIR_SRC=src/
|
|
|
|
|
|
|
|
CFLAGS= -I $(DIR_SRC) -Wall -g -pg -DDEBUG $(shell mariadb-config --cflags --include )
|
|
|
|
LIBS = $(shell mariadb-config --libs ) -lpthread -lami_c
|
|
|
|
|
|
|
|
OBJ = \
|
|
|
|
build/main.o \
|
|
|
|
build/parse_events.o \
|
|
|
|
build/database.o \
|
|
|
|
build/frame_asterisk.o \
|
|
|
|
build/parse_actions.o \
|
|
|
|
build/methods_actions.o \
|
|
|
|
build/peer.o \
|
|
|
|
build/peer_db.o \
|
|
|
|
build/queue.o \
|
|
|
|
build/queue_db.o \
|
|
|
|
build/agent.o \
|
|
|
|
build/agent_db.o \
|
|
|
|
build/log.o \
|
|
|
|
build/string_functions.o
|
|
|
|
|
|
|
|
|
|
|
|
ami_simplesip: $(OBJ)
|
|
|
|
$(CC) -g -o $@ $^ $(LIBS) -lpthread
|
|
|
|
|
|
|
|
$(DIR_OBJ)%.o: $(DIR_SRC)%.c
|
|
|
|
$(CC) -pg -c -o $@ $< $(CFLAGS)
|
|
|
|
|
|
|
|
|
|
|
|
$(DIR_OBJ)%.o: $(DIR_SRC)peer/%.c
|
|
|
|
$(CC) -pg -c -o $@ $< $(CFLAGS)
|
|
|
|
|
|
|
|
|
|
|
|
$(DIR_OBJ)%.o: $(DIR_SRC)bridge/%.c
|
|
|
|
$(CC) -pg -c -o $@ $< $(CFLAGS)
|
|
|
|
|
|
|
|
|
|
|
|
$(DIR_OBJ)%.o: $(DIR_SRC)channel/%.c
|
|
|
|
$(CC) -pg -c -o $@ $< $(CFLAGS)
|
|
|
|
|
|
|
|
|
|
|
|
$(DIR_OBJ)%.o: $(DIR_SRC)agent/%.c
|
|
|
|
$(CC) -pg -c -o $@ $< $(CFLAGS)
|
|
|
|
|
|
|
|
|
|
|
|
$(DIR_OBJ)%.o: $(DIR_SRC)queue/%.c
|
|
|
|
$(CC) -c -o $@ $< $(CFLAGS)
|
|
|
|
|
|
|
|
|
|
|
|
$(DIR_OBJ)%.o: $(DIR_SRC)frame/%.c
|
|
|
|
$(CC) -c -o $@ $< $(CFLAGS)
|
|
|
|
|
|
|
|
|
|
|
|
$(DIR_OBJ)%.o: $(DIR_SRC)database/%.c
|
|
|
|
$(CC) -pg -c -o $@ $< $(CFLAGS)
|
|
|
|
|
|
|
|
|
|
|
|
$(DIR_OBJ)%.o: $(DIR_SRC)log/%.c
|
|
|
|
$(CC) -pg -c -o $@ $< $(CFLAGS)
|
|
|
|
|
|
|
|
|
|
|
|
rpm: $(OBJ)
|
|
|
|
mkdir -p $(DESTDIR)/etc/systemd/system/
|
|
|
|
mkdir -p $(DESTDIR)/usr/sbin
|
|
|
|
|
|
|
|
install -m 0744 systemd/ami_simplesip.service $(DESTDIR)/etc/systemd/system/ami_simplesip.service
|
|
|
|
install -m 0700 etc/client_ami.conf $(DESTDIR)/etc/client_ami.conf
|
|
|
|
install -m 0755 ami_simplesip $(DESTDIR)/usr/sbin/ami_simplesip
|
|
|
|
|
|
|
|
.PHONY: uninstall
|
|
|
|
uninstall:
|
|
|
|
$(info uninstall ainda por fazer)
|
|
|
|
|
|
|
|
|
|
|
|
.PHONY: clean
|
|
|
|
clean:
|
|
|
|
rm -f build/*.o
|
|
|
|
rm -f manager_simples_ip
|
|
|
|
|
|
|
|
|