Xinqi Bao's Git

Merge pull request #38 from stoeckmann/terminating-nul
[slstatus.git] / Makefile
index d20ad8f..9e1d0d5 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -2,52 +2,27 @@
 
 include config.mk
 
 
 include config.mk
 
-SRC = ${NAME}.c
-OBJ = ${SRC:.c=.o}
+all: slstatus
 
 
-all: options ${NAME}
+slstatus: slstatus.c config.h config.mk
+       ${CC} ${CFLAGS} -o $@ slstatus.c ${LDFLAGS}
 
 
-options:
-       @echo ${NAME} build options:
-       @echo "CFLAGS   = ${CFLAGS}"
-       @echo "LDFLAGS  = ${LDFLAGS}"
-       @echo "CC       = ${CC}"
-
-.c.o:
-       @echo CC $<
-       @${CC} -c ${CFLAGS} $<
-
-${OBJ}: config.h config.mk
-
-config.h: config.def.h
-       @echo creating $@ from config.def.h
-       @cp config.def.h $@
-
-${NAME}: ${OBJ}
-       @echo CC -o $@
-       @${CC} -o $@ ${OBJ} ${LDFLAGS}
+config.h:
+       cp config.def.h $@
 
 clean:
 
 clean:
-       @echo cleaning
-       @rm -f ${NAME} ${OBJ} ${NAME}-${VERSION}.tar.gz
-
-dist: clean
-       @echo creating dist tarball
-       @mkdir -p ${NAME}-${VERSION}
-       @cp -R Makefile config.mk LICENSE \
-               ${SRC} ${NAME}-${VERSION}
-       @tar -cf ${NAME}-${VERSION}.tar ${NAME}-${VERSION}
-       @gzip ${NAME}-${VERSION}.tar
-       @rm -rf ${NAME}-${VERSION}
+       rm -f slstatus
 
 install: all
 
 install: all
-       @echo installing executable file to ${DESTDIR}${PREFIX}/bin
-       @mkdir -p ${DESTDIR}${PREFIX}/bin
-       @cp -f ${NAME} ${DESTDIR}${PREFIX}/bin
-       @chmod 755 ${DESTDIR}${PREFIX}/bin/${NAME}
+       mkdir -p ${DESTDIR}${PREFIX}/bin
+       cp -f slstatus ${DESTDIR}${PREFIX}/bin
+       chmod 755 ${DESTDIR}${PREFIX}/bin/slstatus
+       mkdir -p ${DESTDIR}${MANPREFIX}/man1
+       cp -f slstatus.1 ${DESTDIR}${MANPREFIX}/man1
+       chmod 644 ${DESTDIR}${MANPREFIX}/man1/slstatus.1
 
 uninstall:
 
 uninstall:
-       @echo removing executable file from ${DESTDIR}${PREFIX}/bin
-       @rm -f ${DESTDIR}${PREFIX}/bin/${NAME}
+       rm -f ${DESTDIR}${PREFIX}/bin/slstatus
+       rm -f ${DESTDIR}${MANPREFIX}/man1/slstatus.1
 
 
-.PHONY: all options clean dist install uninstall
+.PHONY: all clean install uninstall