[hackers] [wmii] Finish support for .depend makefiles and the 'make depend' target.

From: Kris Maglione <jg_AT_suckless.org>
Date: Fri, 01 Jun 2007 01:10:13 -0000

changeset: 2122:03c0d6f15f55
user: Kris Maglione <jg_AT_suckless.org>
date: Mon Apr 23 02:29:02 2007 -0400
summary: Finish support for .depend makefiles and the 'make depend' target.

diff -r 18e382dfbf7b -r 03c0d6f15f55 cmd/wmii/fs.c
--- a/cmd/wmii/fs.c Sun Apr 22 12:31:52 2007 -0400
+++ b/cmd/wmii/fs.c Mon Apr 23 02:29:02 2007 -0400
@@ -268,9 +268,9 @@ message_root(char *message) {
                 srv.running = 0;
         else if(!strecmp(message, "exec ")) {
                 message += sizeof("exec ")-1;
+ execstr = emalloc(strlen(message) + sizeof("exec "));
+ sprintf(execstr, "exec %s", message);
                 srv.running = 0;
- execstr = emalloc(strlen(message) + sizeof("exec "));
- sprintf(execstr, "exec %s", &message[5]);
         }
         else if(!strecmp(message, "view ")) {
                 message += sizeof("view ")-1;
diff -r 18e382dfbf7b -r 03c0d6f15f55 cmd/wmii/main.c
--- a/cmd/wmii/main.c Sun Apr 22 12:31:52 2007 -0400
+++ b/cmd/wmii/main.c Mon Apr 23 02:29:02 2007 -0400
@@ -509,6 +509,7 @@ main(int argc, char *argv[]) {
 
         if(exitsignal)
                 raise(exitsignal);
+ fprintf(stderr, "execstr: %s\n", execstr);
         if(execstr)
                 execl("/bin/sh", "sh", "-c", execstr, nil);
         if(errstr)
diff -r 18e382dfbf7b -r 03c0d6f15f55 config.mk
--- a/config.mk Sun Apr 22 12:31:52 2007 -0400
+++ b/config.mk Mon Apr 23 02:29:02 2007 -0400
@@ -16,6 +16,7 @@ CFLAGS = -g -Wall
 CFLAGS = -g -Wall
 LDFLAGS = -g ${LIBS}
 STATIC = -static
+MKDEP = cpp -M
 
 # Compiler
 CC = cc -c
@@ -28,7 +29,6 @@ INCX11 = -I/usr/X11R6/include
 INCX11 = -I/usr/X11R6/include
 LIBX11 = -L/usr/X11R6/lib -lX11
 LIBICONV = # Leave blank if your libc includes iconv (glibc does)
-INCICONV = /usr/include
 LIBIXP = ${ROOT}/libixp/libixp.a
 LIBIXP = ${LIBDIR}/libixp.a
 
diff -r 18e382dfbf7b -r 03c0d6f15f55 mk/common.mk
--- a/mk/common.mk Sun Apr 22 12:31:52 2007 -0400
+++ b/mk/common.mk Mon Apr 23 02:29:02 2007 -0400
@@ -1,7 +1,6 @@ all:
 all:
 
 install: all
-depend: cleandep
 
 MANDIRS=${MAN}/man1
 mkdirs:
@@ -11,6 +10,11 @@ mkdirs:
         done
 
 cleandep:
+ echo CLEANDEP
         rm .depend 2>/dev/null || true
 
+DEP:=${shell if test -f .depend;then echo .depend;else echo /dev/null; fi}
+DEP!=echo /dev/null
+include ${DEP}
+
 .PHONY: all options clean dist install uninstall depend cleandep
diff -r 18e382dfbf7b -r 03c0d6f15f55 mk/hdr.mk
--- a/mk/hdr.mk Sun Apr 22 12:31:52 2007 -0400
+++ b/mk/hdr.mk Mon Apr 23 02:29:02 2007 -0400
@@ -3,7 +3,8 @@ all:
 all:
 
 .c.depend:
- ${DEPEND} $< >>.depend
+ echo MKDEP $<
+ ${MKDEP} ${FULLCFLAGS} $< >>.depend
 
 .c.o:
         ${COMPILE} $@ $<
@@ -72,9 +73,11 @@ mkdirs:
 mkdirs:
 clean:
 install: printinstall mkdirs
+depend: cleandep
 
 FILTER = cat
-COMPILE= CC="${CC}" CFLAGS="${CFLAGS} -I$$(echo ${INCPATH}|sed 's/:/ -I/g') ${EXCFLAGS}" ${ROOT}/util/compile
+FULLCFLAGS = ${CFLAGS} -I$$(echo ${INCPATH}|sed 's/:/ -I/g') ${EXCFLAGS}
+COMPILE= CC="${CC}" CFLAGS="${FULLCFLAGS}" ${ROOT}/util/compile
 LINK= LD="${LD}" LDFLAGS="${LDFLAGS} ${EXLDFLAGS}" ${ROOT}/util/link
 
 include ${ROOT}/config.mk
Received on Fri Jun 01 2007 - 03:10:11 UTC

This archive was generated by hypermail 2.2.0 : Sun Jul 13 2008 - 15:57:04 UTC