summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile14
1 files changed, 11 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index 939430a..89ab0b7 100644
--- a/Makefile
+++ b/Makefile
@@ -3,6 +3,10 @@ TQFTPSERV := tqftpserv
CFLAGS := -Wall -g -O2
LDFLAGS := -lqrtr
+prefix ?= /usr/local
+bindir := $(prefix)/bin
+servicedir := $(prefix)/lib/systemd/system
+
SRCS := tqftpserv.c
OBJS := $(SRCS:.c=.o)
@@ -10,8 +14,12 @@ OBJS := $(SRCS:.c=.o)
$(TQFTPSERV): $(OBJS)
$(CC) -o $@ $^ $(LDFLAGS)
-install: $(TQFTPSERV)
- install -D -m 755 $< $(DESTDIR)$(prefix)/bin/$<
+tqftpserv.service: tqftpserv.service.in
+ @sed 's+TQFTPSERV_PATH+$(bindir)+g' $< > $@
+
+install: $(TQFTPSERV) tqftpserv.service
+ @install -D -m 755 $(TQFTPSERV) $(DESTDIR)$(bindir)/$(TQFTPSERV)
+ @install -D -m 644 tqftpserv.service $(DESTDIR)$(servicedir)/tqftpserv.service
clean:
- rm -f $(TQFTPSERV) $(OBJS)
+ rm -f $(TQFTPSERV) $(OBJS) tqftpserv.service