pacebin/Makefile

38 lines
865 B
Makefile
Raw Permalink Normal View History

2021-09-19 01:50:57 +03:00
prefix=/usr/local
confdir=/etc
systemd_dir=${DESTDIR}${confdir}/systemd/system
nginx_dir=${DESTDIR}${confdir}/nginx
bindir=${DESTDIR}${prefix}/bin
DISABLE_CUSTOM_LINKS ?= 0
2022-01-23 19:12:48 +02:00
MAX_SIZE ?= 52428800
CC ?= gcc
2022-01-23 19:12:48 +02:00
CFLAGS := -O2 -DDISABLE_CUSTOM_LINKS=${DISABLE_CUSTOM_LINKS} -DMG_MAX_RECV_BUF_SIZE=${MAX_SIZE} ${CFLAGS}
2021-09-19 01:50:57 +03:00
BIN := pacebin
SOURCE := main.c mongoose.c
OBJ := mongoose.o main.o
DEPS := mongoose.h index.h
LIBS := -lcrypt
all: $(BIN)
clean:
rm -f $(OBJ)
$(BIN): $(OBJ)
$(CC) $(CFLAGS) -o $@ $^ $(LIBS)
install-nginx:
2021-09-19 01:55:24 +03:00
@install -Dm644 doc/pacebin.nginx ${nginx_dir}/sites-available/pacebin
2021-09-19 01:50:57 +03:00
install-systemd:
2021-09-19 01:55:24 +03:00
@install -Dm644 doc/pacebin.service ${systemd_dir}/pacebin.service
@install -Dm644 doc/pacebin.conf ${DESTDIR}/${confdir}/pacebin.conf
2021-09-19 01:50:57 +03:00
install-bin:
@install -Dm755 ${BIN} ${bindir}/${BIN}
install: install-bin install-nginx install-systemd