summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorHåkon Nessjøen <haakon.nessjoen@gmail.com>2011-08-11 00:30:29 +0200
committerHåkon Nessjøen <haakon.nessjoen@gmail.com>2011-08-11 00:30:29 +0200
commit053b2fdf6400a2557bd1a4340f2fbeefedfcff13 (patch)
tree91455e96bf973580e55c5fe31da95e08d012d116 /Makefile
parent7852da33d25ced23652089f1942ff38e52693ebc (diff)
downloadMAC-Telnet-053b2fdf6400a2557bd1a4340f2fbeefedfcff13.tar.gz
MAC-Telnet-053b2fdf6400a2557bd1a4340f2fbeefedfcff13.zip
Cleanup in Makefile and docs according to tips from Nelson A. de Oliveira
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile54
1 files changed, 22 insertions, 32 deletions
diff --git a/Makefile b/Makefile
index 9d8c1f1..51c39dc 100644
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,6 @@
-CC=gcc
-CCFLAGS=
+CC?=gcc
+CFLAGS+=
all: macping mndp mactelnet mactelnetd
@@ -10,53 +10,43 @@ dist-clean:
rm -f mactelnet macping mactelnetd mndp
rm -f *.o
-strip-all: mndp macping mactelnet mactelnetd
- strip -s mndp
- strip -s macping
- strip -s mactelnet
- strip -s mactelnetd
-
-install: all strip-all install-docs
- mkdir -p $(DESTDIR)/usr/bin
- cp mndp $(DESTDIR)/usr/bin/
- cp macping $(DESTDIR)/usr/bin/
- cp mactelnet $(DESTDIR)/usr/bin/
- mkdir -p $(DESTDIR)/usr/sbin
- cp mactelnetd $(DESTDIR)/usr/sbin/
- mkdir -p $(DESTDIR)/etc
- cp config/mactelnetd.users $(DESTDIR)/etc/
-# Ubuntu upstart script
-# cp config/mactelnetd.init /etc/init/
- chown root $(DESTDIR)/etc/mactelnetd.users
- chmod 600 $(DESTDIR)/etc/mactelnetd.users
+install: all install-docs
+ install -d $(DESTDIR)/usr/bin
+ install mndp $(DESTDIR)/usr/bin/
+ install macping $(DESTDIR)/usr/bin/
+ install mactelnet $(DESTDIR)/usr/bin/
+ install -d $(DESTDIR)/usr/sbin
+ install -o root mactelnetd $(DESTDIR)/usr/sbin/
+ install -d $(DESTDIR)/etc
+ install -m 600 -o root config/mactelnetd.users $(DESTDIR)/etc/
install-docs:
- mkdir -p $(DESTDIR)/usr/share/man/man1/
- cp docs/*.1 $(DESTDIR)/usr/share/man/man1/
+ install -d $(DESTDIR)/usr/share/man/man1/
+ install docs/*.1 $(DESTDIR)/usr/share/man/man1/
udp.o: udp.c udp.h
- ${CC} -Wall ${CCFLAGS} -c udp.c
+ ${CC} -Wall ${CFLAGS} -c udp.c
users.o: users.c users.h
- ${CC} -Wall ${CCFLAGS} -DUSERSFILE='"/etc/mactelnetd.users"' -c users.c
+ ${CC} -Wall ${CFLAGS} -DUSERSFILE='"/etc/mactelnetd.users"' -c users.c
protocol.o: protocol.c protocol.h
- ${CC} -Wall ${CCFLAGS} -c protocol.c
+ ${CC} -Wall ${CFLAGS} -c protocol.c
devices.o: devices.c devices.h
- ${CC} -Wall ${CCFLAGS} -c devices.c
+ ${CC} -Wall ${CFLAGS} -c devices.c
md5.o: md5.c md5.h
- ${CC} -Wall ${CCFLAGS} -c md5.c
+ ${CC} -Wall ${CFLAGS} -c md5.c
mactelnet: config.h udp.o mactelnet.c mactelnet.h protocol.o console.c console.h devices.o md5.o
- ${CC} -Wall ${CCFLAGS} -o mactelnet mactelnet.c udp.o protocol.o console.c devices.o md5.o
+ ${CC} -Wall ${CFLAGS} -o mactelnet mactelnet.c udp.o protocol.o console.c devices.o md5.o
mactelnetd: config.h mactelnetd.c udp.o protocol.o devices.o console.c console.h users.o users.h md5.o
- ${CC} -Wall ${CCFLAGS} -o mactelnetd mactelnetd.c udp.o protocol.o console.c devices.o users.o md5.o
+ ${CC} -Wall ${CFLAGS} -o mactelnetd mactelnetd.c udp.o protocol.o console.c devices.o users.o md5.o
mndp: config.h mndp.c protocol.o
- ${CC} -Wall ${CCFLAGS} -o mndp mndp.c protocol.o
+ ${CC} -Wall ${CFLAGS} -o mndp mndp.c protocol.o
macping: config.h macping.c udp.o devices.o protocol.o
- ${CC} -Wall ${CCFLAGS} -o macping macping.c devices.o udp.o protocol.o
+ ${CC} -Wall ${CFLAGS} -o macping macping.c devices.o udp.o protocol.o