loperIRCLogBot/Makefile

49 lines
1.3 KiB
Makefile
Raw Normal View History

2017-03-27 11:15:34 +03:00
# Compiler
CC=gcc
# Flags
2017-12-03 10:39:21 +03:00
# CFLAGS=-lircclient
# CFLAGS=-static libircclient.a
2017-03-27 11:15:34 +03:00
MKDIR_P = mkdir -p
2017-12-03 10:39:21 +03:00
APP_NAME = loperIRCLogBot
SYSTEMD_DETECT = shell cat /proc/1/comm|grep systemd
2017-03-27 11:15:34 +03:00
2017-12-03 10:39:21 +03:00
all: lib $(APP_NAME)
2017-03-27 11:15:34 +03:00
lib:
2017-12-03 10:39:21 +03:00
cp ./src/files/* ./src/libircclient-1.9/src/
2017-11-20 15:09:35 +03:00
# patch -p0 -i ./files/patchFile
2017-12-03 10:39:21 +03:00
$(MAKE) -C ./src/libircclient-1.9/src/ || exit 1;
cp -r ./src/libircclient-1.9/include/ ./src/libircclient
cp ./src/libircclient-1.9/src/libircclient.a ./src
2017-03-27 11:15:34 +03:00
2017-12-03 10:39:21 +03:00
loperIRCLogBot: ./src/$(APP_NAME).c
2017-03-27 11:15:34 +03:00
$(MKDIR_P) ./bin
2017-12-03 10:39:21 +03:00
# $(CC) $(CFLAGS) $(APP_NAME).c -o ./bin/loperIRCLogBot
$(CC) -std=gnu89 ./src/$(APP_NAME).c ./src/libircclient.a -o ./bin/$(APP_NAME)
2017-03-27 11:15:34 +03:00
clean:
2017-12-03 10:39:21 +03:00
rm -rf ./bin/*.o \
./bin/loperIRCLogBot \
./src/libircclient \
./src/libircclient.a \
./src/libircclient-1.9/src/libircclient.o \
./src/libircclient-1.9/src/libircclient.a \
./src/libircclient-1.9/src/config.h \
./src/libircclient-1.9/src/Makefile
install:
install ./bin/loperIRCLogBot /usr/bin
$(MKDIR_P) /etc/$(APP_NAME)
ifeq ($(SYSTEMD_DETECT),'systemd')
cp ./src/files/loperIRCLogBot.service /etc/systemd/system/loperIRCLogBot.service
else
@echo "* Not a systemD distro. Skipping unit installation."
endif
uninstall:
rm /usr/bin/loperIRCLogBot
rmdir /etc/$(APP_NAME)
ifeq ($(SYSTEMD_DETECT),'systemd')
rm -rf /etc/systemd/system/loperIRCLogBot.service
endif