Skip to content

Commit 8e68a2b

Browse files
author
Herminio Hernandez Jr
committed
Update Makefile to use install instad of cp. The manpage, systemd .service file, and README will also be installed. This change will allow the building of .deb packages.
1 parent 5db89e4 commit 8e68a2b

File tree

1 file changed

+18
-4
lines changed

1 file changed

+18
-4
lines changed

Makefile

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ OUTPUT_PATH = bin/
66
SOURCE_PATH = src/
77
EXE = bin/mbpfan
88
CONF = mbpfan.conf
9+
SYSD = mbpfan.service
10+
DOC = README.md
11+
MAN = mbpfan.8.gz
912

1013
ifeq ($(COMPILER), G++)
1114
ifeq ($(OS),Windows_NT)
@@ -23,8 +26,8 @@ ifeq ($(COMPILER), G++)
2326
LIBS = -lm
2427
# LIBPATH = -L../gc/.libs
2528
LIBPATH =
26-
CPPFLAGS = $(COPT) -g $(INCLUDES)
27-
LDFLAGS = $(LIBPATH) -g $(LIBS)
29+
CPPFLAGS += $(COPT) -g $(INCLUDES) -Wall
30+
LDFLAGS += $(LIBPATH) -g $(LIBS) -Wall
2831
DEP = dep
2932
else
3033
OBJ = obj
@@ -61,11 +64,22 @@ tests:
6164
uninstall:
6265
rm /usr/sbin/mbpfan
6366
rm /etc/mbpfan.conf
67+
rm /lib/systemd/system/mbpfan.service
68+
rm /usr/share/man/man8/mbpfan.8.gz
69+
rm -rf /usr/share/doc/mbpfan
6470

6571
install:
6672
make
67-
cp $(EXE) /usr/sbin
68-
cp -n $(CONF) /etc
73+
install -d $(DESTDIR)/usr/sbin
74+
install -d $(DESTDIR)/etc
75+
install -d $(DESTDIR)/lib/systemd/system
76+
install -d $(DESTDIR)/usr/share/doc/mbpfan
77+
install $(EXE) $(DESTDIR)/usr/sbin
78+
install -m644 $(CONF) $(DESTDIR)/etc
79+
install -m644 $(SYSD) $(DESTDIR)/lib/systemd/system
80+
install -m644 $(DOC) $(DESTDIR)/usr/share/doc/mbpfan
81+
install -d $(DESTDIR)/usr/share/man/man8
82+
install -m644 $(MAN) $(DESTDIR)/usr/share/man/man8
6983
@echo ""
7084
@echo "******************"
7185
@echo "INSTALL COMPLETED"

0 commit comments

Comments
 (0)