tUse implicit rules in makefile - wendy - watch files/directories and run commands on any event
HTML git clone git://z3bra.org/wendy
DIR Log
DIR Files
DIR Refs
DIR README
DIR LICENSE
---
DIR commit e0d77986af818120da2174f5bb7a1e2688773592
DIR parent 1cfef0a6de2446814e1947e5bc0e73ab744f2d6d
HTML Author: z3bra <contactatz3bradotorg>
Date: Thu, 20 Apr 2017 13:42:49 +0200
Use implicit rules in makefile
Diffstat:
M Makefile | 22 +++++++++-------------
M config.mk | 6 +++---
2 files changed, 12 insertions(+), 16 deletions(-)
---
DIR diff --git a/Makefile b/Makefile
t@@ -4,19 +4,15 @@ include config.mk
wendy: wendy.o
-.c.o:
- $(CC) -c $(CFLAGS) $< -o $@
+install: wendy wendy.1
+ mkdir -p $(DESTDIR)$(PREFIX)/bin
+ mkdir -p $(DESTDIR)$(MANDIR)/man1
+ cp wendy $(DESTDIR)$(PREFIX)/bin/wendy
+ cp wendy.1 $(DESTDIR)$(MANDIR)/man1/wendy.1
-.o:
- $(LD) $(LDFLAGS) $< -o $@
+uninstall:
+ rm -f $(DESTDIR)$(PREFIX)/bin/wendy
+ rm -f $(DESTDIR)$(MANDIR)/man1/wendy.1
-clean :
+clean:
rm -f wendy *.o
-
-install :
- install -D -m0755 wendy ${DESTDIR}${PREFIX}/bin/wendy
- install -D -m0644 wendy.1 ${DESTDIR}${MANDIR}/man1/wendy.1
-
-uninstall:
- rm -f ${DESTDIR}${PREFIX}/bin/wendy
- rm -f ${DESTDIR}${MANDIR}/man1/wendy.1
DIR diff --git a/config.mk b/config.mk
t@@ -1,7 +1,7 @@
CC = cc
-LD = ${CC}
-CFLAGS = -Wall -Wextra -pedantic
+LD = $(CC)
+CFLAGS =
LDFLAGS =
PREFIX = /usr/local
-MANDIR = ${PREFIX}/man
+MANDIR = $(PREFIX)/man