diff --git a/Makefile b/Makefile index 6bee6a2..0d28970 100644 --- a/Makefile +++ b/Makefile @@ -6,6 +6,9 @@ OUTPUT_PATH = bin/ SOURCE_PATH = src/ EXE = bin/mbpfan CONF = mbpfan.conf +SYSD = mbpfan.service +DOC = README.md +MAN = mbpfan.8.gz ifeq ($(COMPILER), G++) ifeq ($(OS),Windows_NT) @@ -23,8 +26,8 @@ ifeq ($(COMPILER), G++) LIBS = -lm # LIBPATH = -L../gc/.libs LIBPATH = - CPPFLAGS = $(COPT) -g $(INCLUDES) - LDFLAGS = $(LIBPATH) -g $(LIBS) + CPPFLAGS += $(COPT) -g $(INCLUDES) -Wall + LDFLAGS += $(LIBPATH) -g $(LIBS) -Wall DEP = dep else OBJ = obj @@ -61,11 +64,22 @@ tests: uninstall: rm /usr/sbin/mbpfan rm /etc/mbpfan.conf + rm /lib/systemd/system/mbpfan.service + rm /usr/share/man/man8/mbpfan.8.gz + rm -rf /usr/share/doc/mbpfan install: make - cp $(EXE) /usr/sbin - cp -n $(CONF) /etc + install -d $(DESTDIR)/usr/sbin + install -d $(DESTDIR)/etc + install -d $(DESTDIR)/lib/systemd/system + install -d $(DESTDIR)/usr/share/doc/mbpfan + install $(EXE) $(DESTDIR)/usr/sbin + install -m644 $(CONF) $(DESTDIR)/etc + install -m644 $(SYSD) $(DESTDIR)/lib/systemd/system + install -m644 $(DOC) $(DESTDIR)/usr/share/doc/mbpfan + install -d $(DESTDIR)/usr/share/man/man8 + install -m644 $(MAN) $(DESTDIR)/usr/share/man/man8 @echo "" @echo "******************" @echo "INSTALL COMPLETED"