X-Git-Url: https://git.xinqibao.xyz/slstatus.git/blobdiff_plain/410ba38a0160da8cbcc81dddd704ae9c7f6d15e2..8dad4910bfc75aa1085a20de95ceee951588deae:/Makefile?ds=inline

diff --git a/Makefile b/Makefile
index d20ad8f..dbe636e 100644
--- a/Makefile
+++ b/Makefile
@@ -1,53 +1,28 @@
 # See LICENSE file for copyright and license details.
+# slstatus - suckless status monitor
+.POSIX:
 
 include config.mk
 
-SRC = ${NAME}.c
-OBJ = ${SRC:.c=.o}
+all: slstatus
 
-all: options ${NAME}
+slstatus: slstatus.c config.h config.mk
+	$(CC) -o $@ $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) slstatus.c $(LDLIBS)
 
-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:
-	@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
-	@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:
-	@echo removing executable file from ${DESTDIR}${PREFIX}/bin
-	@rm -f ${DESTDIR}${PREFIX}/bin/${NAME}
-
-.PHONY: all options clean dist install uninstall
+	rm -f "$(DESTDIR)$(PREFIX)/bin/slstatus"
+	rm -f "$(DESTDIR)$(MANPREFIX)/man1/slstatus.1"