Makefile (1602B)
1 # utmp - simple login 2 # See LICENSE file for copyright and license details. 3 4 include config.mk 5 6 DIST = LICENSE Makefile config.mk utmp.1 utmp.c bsd.c posix.c 7 VERSION = 0.2 8 9 all: options utmp 10 11 options: 12 @echo utmp build options: 13 @echo "CFLAGS = ${CFLAGS}" 14 @echo "CPPFLAGS = ${CPPFLAGS}" 15 @echo "LDFLAGS = ${LDFLAGS}" 16 @echo "LDLIBS = ${LDLIBS}" 17 @echo "CC = ${CC}" 18 19 .c.o: 20 @echo CC $< 21 @${CC} $(CFLAGS) $(CPPFLAGS) -c $< 22 23 utmp: $(OBJS) 24 @echo CC -o $@ 25 @$(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) $(OBJS) $(LDLIBS) -o $@ 26 27 distclean: clean 28 @echo cleaning for distribution 29 @rm config.mk 30 clean: 31 @echo cleaning 32 @rm -f utmp utmp-${VERSION}.tar.gz *.o 33 34 dist: clean 35 @echo creating dist tarball 36 @mkdir -p utmp-${VERSION} 37 @cp -R $(DIST) utmp-${VERSION} 38 @tar -cf - utmp-${VERSION} | gzip > utmp-${VERSION}.tar.gz 39 @rm -rf utmp-${VERSION} 40 41 install: all 42 @echo installing executable file to ${DESTDIR}${PREFIX}/bin 43 @mkdir -p ${DESTDIR}${PREFIX}/bin 44 @cp -f utmp ${DESTDIR}${PREFIX}/bin 45 @chmod 755 ${DESTDIR}${PREFIX}/bin/utmp 46 @chgrp ${GROUP} ${DESTDIR}${PREFIX}/bin/utmp 47 @chmod g+s ${DESTDIR}${PREFIX}/bin/utmp 48 @echo installing manual page to ${DESTDIR}${MANPREFIX}/man1 49 @mkdir -p ${DESTDIR}${MANPREFIX}/man1 50 @sed "s/VERSION/${VERSION}/g" < utmp.1 > ${DESTDIR}${MANPREFIX}/man1/utmp.1 51 @chmod 644 ${DESTDIR}${MANPREFIX}/man1/utmp.1 52 53 uninstall: 54 @echo removing executable file from ${DESTDIR}${PREFIX}/bin 55 @rm -f ${DESTDIR}${PREFIX}/bin/utmp 56 @echo removing manual page from ${DESTDIR}${PREFIX}/man1 57 @rm -f ${DESTDIR}${MANPREFIX}/man1/utmp.1 58 59 .PHONY: options clean dist install uninstall