tImproved 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 cce81874b8809f1024cc5062b7e1bf4380292db3
DIR parent 9bf0c01d89e1eb9ae80427e451a8fb553bcf7e35
HTML Author: z3bra <willy@mailoo.org>
Date: Mon, 10 Feb 2014 09:47:18 +0100
Improved makefile
Diffstat:
M Makefile | 35 +++++++++++++++----------------
1 file changed, 17 insertions(+), 18 deletions(-)
---
DIR diff --git a/Makefile b/Makefile
t@@ -1,7 +1,6 @@
# BEGINNING OF THE FILE
# Compilation settings
-PROG=wendy
CC=gcc
CFLAGS=-Wall -I inc --std=c99 -pedantic
LDFLAGS=
t@@ -9,28 +8,28 @@ LDFLAGS=
# Command paths
RM=/bin/rm
+.SUFFIXE :
+.SUFFIXES : .c .o .h
.PHONY : all list mrproper clean init
-$(PROG) : $(PROG).o
- @echo -e "LD $(PROG)"
- @$(CC) $^ -o$@ $(LDFLAGS)
-
-$(PROG).o : $(PROG).c
+.c.o:
@echo -e "CC $<"
- @$(CC) -c $(CFLAGS) $< -o $@
+ @${CC} -c $^ -o $< ${CFLAGS}
-all : clean $(PROG)
+wendy : wendy.o
+ @echo -e "LD wendy"
+ @${CC} $^ -o $@ ${LDFLAGS}
-mrproper : clean
- $(RM) $(PROG)
+all : init wendy
clean :
- $(RM) -f *.o
- $(RM) -f *~
-
-init :
- @echo "CC = $(CC)"
- @echo "CFLAGS = $(CFLAGS)"
- @echo "LDFLAGS = $(LDFLAGS)"
- @echo
+ ${RM} wendy
+ ${RM} -f *.o
+ ${RM} -f *~
+
+install :
+ install -D -m0755 wendy ${DESTDIR}${PREFIX}/bin/wendy
+
+uninstall:
+ ${RM} ${DESTDIR}${PREFIX}/bin/wendy
## EOF