[hackers] [wmii] Fix build for gmake. Add uninstall target. Fix if statement with no command.

From: Kris Maglione <jg_AT_suckless.org>
Date: Mon Mar 26 19:02:47 2007

changeset: 2036:1d1998c153c3
tag: tip
user: Kris Maglione <jg_AT_suckless.org>
date: Mon Mar 26 12:57:46 2007 -0400
summary: Fix build for gmake. Add uninstall target. Fix if statement with no command.

diff -r bf6795588403 -r 1d1998c153c3 cmd/Makefile
--- a/cmd/Makefile Mon Mar 26 01:40:47 2007 -0400
+++ b/cmd/Makefile Mon Mar 26 12:57:46 2007 -0400
@@ -1,6 +1,8 @@ ROOT=..
 ROOT=..
 include ${ROOT}/mk/hdr.mk
 include ${ROOT}/mk/wmii.mk
+
+wmiir.c: ${ROOT}/mk/wmii.mk
 
 DIRS = wmii
 TARG = wmii9menu \
@@ -10,7 +12,7 @@ TARG = wmii9menu \
         wmiistartrc
 
 OFILES = util.o
-FILTER = sed "s|CONFPREFIX|${CONFPREFIX}|g; \
+FILTER = sed "s|CONFPREFIX|${MAN}|g; \
               s|CONFVERSION|${CONFVERSION}|g; \
               s|P9PATHS|${P9PATHS}|g; \
               s|AWKPATH|${AWKPATH}|g"
@@ -18,10 +20,10 @@ include ${ROOT}/mk/many.mk
 include ${ROOT}/mk/many.mk
 include ${ROOT}/mk/dir.mk
 
-OWMIIR=${OFILES} ${LIBIXP}
+OWMIIR=wmiir.o ${OFILES} ${LIBIXP}
 wmiir.O: ${OWMIIR}
- ${LINK} $@ ${STATIC} $*.o ${OWMIIR}
+ ${LINK} $@ ${STATIC} ${OWMIIR}
 
 EXCFLAGS=${INCX11}
-wmii9menu.O:
+wmii9menu.O: wmii9menu.o
         ${LINK} $@ $*.o ${LIBX11}
diff -r bf6795588403 -r 1d1998c153c3 cmd/wmii/Makefile
--- a/cmd/wmii/Makefile Mon Mar 26 01:40:47 2007 -0400
+++ b/cmd/wmii/Makefile Mon Mar 26 12:57:46 2007 -0400
@@ -1,6 +1,8 @@ ROOT= ../..
 ROOT= ../..
 include ${ROOT}/mk/hdr.mk
 include ${ROOT}/mk/wmii.mk
+
+main.c: ${ROOT}/mk/wmii.mk
 
 TARG = wmii
 
diff -r bf6795588403 -r 1d1998c153c3 cmd/wmii/area.c
--- a/cmd/wmii/area.c Mon Mar 26 01:40:47 2007 -0400
+++ b/cmd/wmii/area.c Mon Mar 26 12:57:46 2007 -0400
@@ -5,8 +5,11 @@
 #include <assert.h>
 #include <math.h>
 #include <stdlib.h>
+#include <stdio.h>
 #include <string.h>
-#include "wmii.h"
+#include <util.h>
+#include "dat.h"
+#include "fns.h"
 
 static void place_frame(Frame *f);
 
diff -r bf6795588403 -r 1d1998c153c3 cmd/wmii/bar.c
--- a/cmd/wmii/bar.c Mon Mar 26 01:40:47 2007 -0400
+++ b/cmd/wmii/bar.c Mon Mar 26 12:57:46 2007 -0400
@@ -3,7 +3,9 @@
  * See LICENSE file for license details.
  */
 #include <string.h>
-#include "wmii.h"
+#include <util.h>
+#include "dat.h"
+#include "fns.h"
 
 Bar *free_bars = nil;
 
diff -r bf6795588403 -r 1d1998c153c3 cmd/wmii/client.c
--- a/cmd/wmii/client.c Mon Mar 26 01:40:47 2007 -0400
+++ b/cmd/wmii/client.c Mon Mar 26 12:57:46 2007 -0400
@@ -3,9 +3,12 @@
  * See LICENSE file for license details.
  */
 #include <stdlib.h>
+#include <stdio.h>
 #include <string.h>
 #include <X11/Xatom.h>
-#include "wmii.h"
+#include <util.h>
+#include "dat.h"
+#include "fns.h"
 
 static void update_client_name(Client *c);
 
diff -r bf6795588403 -r 1d1998c153c3 cmd/wmii/column.c
--- a/cmd/wmii/column.c Mon Mar 26 01:40:47 2007 -0400
+++ b/cmd/wmii/column.c Mon Mar 26 12:57:46 2007 -0400
@@ -4,7 +4,9 @@
  */
 #include <math.h>
 #include <string.h>
-#include "wmii.h"
+#include <util.h>
+#include "dat.h"
+#include "fns.h"
 
 char *
 str_of_column_mode(int mode) {
diff -r bf6795588403 -r 1d1998c153c3 cmd/wmii/draw.c
--- a/cmd/wmii/draw.c Mon Mar 26 01:40:47 2007 -0400
+++ b/cmd/wmii/draw.c Mon Mar 26 12:57:46 2007 -0400
@@ -2,8 +2,11 @@
  * See LICENSE file for license details.
  */
 #include <stdlib.h>
+#include <stdio.h>
 #include <string.h>
-#include "wmii.h"
+#include <util.h>
+#include "dat.h"
+#include "fns.h"
 
 uint
 textwidth_l(BlitzFont *font, char *text, uint len) {
diff -r bf6795588403 -r 1d1998c153c3 cmd/wmii/event.c
--- a/cmd/wmii/event.c Mon Mar 26 01:40:47 2007 -0400
+++ b/cmd/wmii/event.c Mon Mar 26 12:57:46 2007 -0400
@@ -2,8 +2,11 @@
  * Copyright ©2006-2007 Kris Maglione <fbsdaemon_AT_gmail.com>
  * See LICENSE file for license details.
  */
+#include <stdio.h>
 #include <X11/keysym.h>
-#include "wmii.h"
+#include <util.h>
+#include "dat.h"
+#include "fns.h"
 #include "printevent.h"
 
 void
diff -r bf6795588403 -r 1d1998c153c3 cmd/wmii/frame.c
--- a/cmd/wmii/frame.c Mon Mar 26 01:40:47 2007 -0400
+++ b/cmd/wmii/frame.c Mon Mar 26 12:57:46 2007 -0400
@@ -1,7 +1,9 @@
 /* Copyright ©2006-2007 Kris Maglione <fbsdaemon_AT_gmail.com>
  * See LICENSE file for license details.
  */
-#include "wmii.h"
+#include <util.h>
+#include "dat.h"
+#include "fns.h"
 
 Frame *
 create_frame(Client *c, View *v) {
diff -r bf6795588403 -r 1d1998c153c3 cmd/wmii/fs.c
--- a/cmd/wmii/fs.c Mon Mar 26 01:40:47 2007 -0400
+++ b/cmd/wmii/fs.c Mon Mar 26 12:57:46 2007 -0400
@@ -3,10 +3,13 @@
  */
 #include <assert.h>
 #include <stdarg.h>
+#include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 #include <time.h>
-#include "wmii.h"
+#include <util.h>
+#include "dat.h"
+#include "fns.h"
 
 
 /* Datatypes: */
diff -r bf6795588403 -r 1d1998c153c3 cmd/wmii/geom.c
--- a/cmd/wmii/geom.c Mon Mar 26 01:40:47 2007 -0400
+++ b/cmd/wmii/geom.c Mon Mar 26 12:57:46 2007 -0400
@@ -1,7 +1,10 @@
 /* Copyright ©2004-2006 Anselm R. Garbe <garbeam at gmail dot com>
  * See LICENSE file for license details.
  */
-#include "wmii.h"
+#include <stdio.h>
+#include <util.h>
+#include "dat.h"
+#include "fns.h"
 
 Bool
 ptinrect(int x, int y, XRectangle * r) {
diff -r bf6795588403 -r 1d1998c153c3 cmd/wmii/key.c
--- a/cmd/wmii/key.c Mon Mar 26 01:40:47 2007 -0400
+++ b/cmd/wmii/key.c Mon Mar 26 12:57:46 2007 -0400
@@ -4,7 +4,9 @@
 #include <string.h>
 #include <stdlib.h>
 #include <X11/keysym.h>
-#include "wmii.h"
+#include <util.h>
+#include "dat.h"
+#include "fns.h"
 
 void
 init_lock_keys() {
diff -r bf6795588403 -r 1d1998c153c3 cmd/wmii/main.c
--- a/cmd/wmii/main.c Mon Mar 26 01:40:47 2007 -0400
+++ b/cmd/wmii/main.c Mon Mar 26 12:57:46 2007 -0400
@@ -9,12 +9,15 @@
 #include <locale.h>
 #include <pwd.h>
 #include <signal.h>
+#include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 #include <sys/stat.h>
 #include <sys/wait.h>
 #include <unistd.h>
-#include "wmii.h"
+#include <util.h>
+#include "dat.h"
+#include "fns.h"
 
 static const char
         version[] = "wmii-"VERSION", ©2007 Kris Maglione\n";
@@ -568,6 +571,7 @@ main(int argc, char *argv[]) {
         check_x_event(nil);
         errstr = ixp_serverloop(&srv);
         if(errstr)
+ fprintf(stderr, "%s: error: %s\n", argv0, errstr);
 
         cleanup();
         XCloseDisplay(blz.dpy);
diff -r bf6795588403 -r 1d1998c153c3 cmd/wmii/mouse.c
--- a/cmd/wmii/mouse.c Mon Mar 26 01:40:47 2007 -0400
+++ b/cmd/wmii/mouse.c Mon Mar 26 12:57:46 2007 -0400
@@ -3,7 +3,9 @@
  */
 #include <stdlib.h>
 #include <string.h>
-#include "wmii.h"
+#include <util.h>
+#include "dat.h"
+#include "fns.h"
 
 enum {
         ButtonMask =
diff -r bf6795588403 -r 1d1998c153c3 cmd/wmii/printevent.c
--- a/cmd/wmii/printevent.c Mon Mar 26 01:40:47 2007 -0400
+++ b/cmd/wmii/printevent.c Mon Mar 26 12:57:46 2007 -0400
@@ -46,7 +46,9 @@ can get it touch with me at the followin
 #include <stdio.h>
 #include <X11/Intrinsic.h>
 #include <X11/Xproto.h>
-#include "wmii.h"
+#include <util.h>
+#include "dat.h"
+#include "fns.h"
 #include "printevent.h"
 
 static char* sep = " ";
diff -r bf6795588403 -r 1d1998c153c3 cmd/wmii/rule.c
--- a/cmd/wmii/rule.c Mon Mar 26 01:40:47 2007 -0400
+++ b/cmd/wmii/rule.c Mon Mar 26 12:57:46 2007 -0400
@@ -5,7 +5,9 @@
 
 #include <string.h>
 #include <stdlib.h>
-#include "wmii.h"
+#include <util.h>
+#include "dat.h"
+#include "fns.h"
 
 /* basic rule matching language /regex/ -> value
  * regex might contain POSIX regex syntax defined in regex(3) */
diff -r bf6795588403 -r 1d1998c153c3 cmd/wmii/view.c
--- a/cmd/wmii/view.c Mon Mar 26 01:40:47 2007 -0400
+++ b/cmd/wmii/view.c Mon Mar 26 12:57:46 2007 -0400
@@ -3,8 +3,11 @@
  * See LICENSE file for license details.
  */
 #include <stdlib.h>
+#include <stdio.h>
 #include <string.h>
-#include "wmii.h"
+#include <util.h>
+#include "dat.h"
+#include "fns.h"
 
 static Bool
 is_empty(View *v) {
diff -r bf6795588403 -r 1d1998c153c3 include/util.h
--- a/include/util.h Mon Mar 26 01:40:47 2007 -0400
+++ b/include/util.h Mon Mar 26 12:57:46 2007 -0400
@@ -1,3 +1,26 @@
+#define nil ((void*)0)
+#define nelem(ary) (sizeof(ary) / sizeof(*ary))
+
+/* Types */
+#undef uchar
+#undef ushort
+#undef uint
+#undef ulong
+#undef uvlong
+#undef vlong
+#define uchar _wmiiuchar
+#define ushort _wmiiushort
+#define uint _wmiiuint
+#define ulong _wmiiulong
+#define vlong _wmiivlong
+#define uvlong _wmiiuvlong
+typedef unsigned char uchar;
+typedef unsigned short ushort;
+typedef unsigned int uint;
+typedef unsigned long ulong;
+typedef unsigned long long uvlong;
+typedef long long vlong;
+
 #define strlcat wmii_strlcat
 /* util.c */
 uint tokenize(char *res[], uint reslen, char *str, char delim);
diff -r bf6795588403 -r 1d1998c153c3 man/Makefile
--- a/man/Makefile Mon Mar 26 01:40:47 2007 -0400
+++ b/man/Makefile Mon Mar 26 12:57:46 2007 -0400
@@ -6,7 +6,7 @@ TARG = wmii.1 \
         wmiir.1 \
         wmiiwm.1
 
-FILTER = sed "s|CONFPREFIX|${CONFPREFIX}|g; \
+FILTER = sed "s|CONFPREFIX|${MAN}|g; \
               s|CONFVERSION|${CONFVERSION}|g; \
               s|P9PATHS|${P9PATHS}|g; \
               s|AWKPATH|${AWKPATH}|g"
diff -r bf6795588403 -r 1d1998c153c3 mk/common.mk
--- a/mk/common.mk Mon Mar 26 01:40:47 2007 -0400
+++ b/mk/common.mk Mon Mar 26 12:57:46 2007 -0400
@@ -11,6 +11,7 @@ mkdirs:
         done
 
 install: ${HFILES:.h=.install}
+uninstall: ${HFILES:.h=.uninstall}
 
 cleandep:
         rm .depend 2>/dev/null || true
diff -r bf6795588403 -r 1d1998c153c3 mk/dir.mk
--- a/mk/dir.mk Mon Mar 26 01:40:47 2007 -0400
+++ b/mk/dir.mk Mon Mar 26 12:57:46 2007 -0400
@@ -16,6 +16,12 @@ dinstall:
                 echo MAKE install ${BASE}$$i/; \
                 (cd $$i && ${MAKE} BASE="${BASE}$$i/" install) || exit $?; \
         done
+duninstall:
+ for i in ${DIRS}; do \
+ if [ ! -d $$i ]; then echo Skipping nonexistent directory: $$i 1>&2; continue; fi; \
+ echo MAKE uninstall ${BASE}$$i/; \
+ (cd $$i && ${MAKE} BASE="${BASE}$$i/" uninstall) || exit $?; \
+ done
 ddepend:
         for i in ${DIRS}; do \
                 if [ ! -d $$i ]; then echo Skipping nonexistent directory: $$i 1>&2; continue; fi; \
@@ -26,4 +32,5 @@ all: dall
 all: dall
 clean: dclean
 install: dinstall
+uninstall: duninstall
 depend: ddepend
diff -r bf6795588403 -r 1d1998c153c3 mk/hdr.mk
--- a/mk/hdr.mk Mon Mar 26 01:40:47 2007 -0400
+++ b/mk/hdr.mk Mon Mar 26 12:57:46 2007 -0400
@@ -1,47 +1,66 @@
 .SILENT:
-.SUFFIXES: .O .o .c .sh .rc .awk .1 .depend .install .clean
+.SUFFIXES: .O .o .c .sh .rc .awk .1 .depend .install .uninstall .clean
 all:
+
+.c.depend:
+ ${DEPEND} $< >>.depend
 
 .c.o:
         ${COMPILE} $@ $<
 
-.c.depend:
- ${DEPEND} $< >>.depend
+.o.O:
+ ${LINK} $@ $<
 
-.o.O:
+.c.O:
+ ${COMPILE} $@ $<
         ${LINK} $@ $<
 
 .awk.O:
         echo FILTER ${BASE}$<
         ${FILTER} $< >$@
+ chmod 0755 $@
 
 .rc.O:
         echo FILTER ${BASE}$<
         ${FILTER} $< >$@
+ chmod 0755 $@
 
 .sh.O:
         echo FILTER ${BASE}$<
         ${FILTER} $< >$@
+ chmod 0755 $@
 
 .O.install:
- echo INSTALL $*
+ echo INSTALL ${BASE}$*
         cp -f $< ${BIN}/$*
         chmod 0755 ${BIN}/$*
+.O.uninstall:
+ echo UNINSTALL ${BASE}$*
+ rm -f ${BIN}/$*
 
 .a.install:
- echo INSTALL $<
+ echo INSTALL ${BASE}$<
         cp -f $< ${LIBDIR}/$<
         chmod 0644 ${LIBDIR}/$<
+.a.uninstall:
+ echo UNINSTALL ${BASE}$<
+ rm -f ${LIBDIR}/$<
 
 .h.install:
- echo INSTALL $<
+ echo INSTALL ${BASE}$<
         cp -f $< ${INCLUDE}/$<
         chmod 0644 ${INCLUDE}/$<
+.h.uninstall:
+ echo UNINSTALL ${BASE}$<
+ rm -f ${INCLUDE}/$<
 
 .1.install:
         echo INSTALL man $*'(1)'
         ${FILTER} $< >${MAN}/man1/$<
         chmod 0644 ${MAN}/man1/$<
+.1.uninstall:
+ echo UNINSTALL man $*'(1)'
+ rm -f ${MAN}/man1/$<
 
 .O.clean:
         rm $< || true 2>/dev/null
diff -r bf6795588403 -r 1d1998c153c3 mk/lib.mk
--- a/mk/lib.mk Mon Mar 26 01:40:47 2007 -0400
+++ b/mk/lib.mk Mon Mar 26 12:57:46 2007 -0400
@@ -4,6 +4,7 @@ all: ${HFILES} ${LIB}
 all: ${HFILES} ${LIB}
 
 install: ${TARG}.install
+uninstall: ${TARG}.uninstall
 clean: libclean
 depend: ${OBJ:=.depend}
 
diff -r bf6795588403 -r 1d1998c153c3 mk/man.mk
--- a/mk/man.mk Mon Mar 26 01:40:47 2007 -0400
+++ b/mk/man.mk Mon Mar 26 12:57:46 2007 -0400
@@ -1,4 +1,5 @@ install: ${TARG:.1=.install}
 install: ${TARG:.1=.install}
+uninstall: ${TARG:.1=.uninstall}
 
 printinstall:
         echo 'Install directories:'
diff -r bf6795588403 -r 1d1998c153c3 mk/many.mk
--- a/mk/many.mk Mon Mar 26 01:40:47 2007 -0400
+++ b/mk/many.mk Mon Mar 26 12:57:46 2007 -0400
@@ -1,8 +1,9 @@ PROGS = ${TARG:=.O}
 PROGS = ${TARG:=.O}
 
-all: ${PROGS}
+all: ${OFILES} ${PROGS}
 
 install: ${TARG:=.install}
+uninstall: ${TARG:=.uninstall}
 clean: manyclean
 
 printinstall:
@@ -10,8 +11,8 @@ printinstall:
         echo ' Bin: ${BIN}'
 
 manyclean:
- for i in ${TARG}; do \
- rm $$i.o; rm $$i.O; \
+ for i in ${TARG:=.o} ${TARG:=.O} ${OFILES}; do \
+ rm $$i; \
         done 2>/dev/null || true
 
 include ${ROOT}/mk/common.mk
diff -r bf6795588403 -r 1d1998c153c3 mk/one.mk
--- a/mk/one.mk Mon Mar 26 01:40:47 2007 -0400
+++ b/mk/one.mk Mon Mar 26 12:57:46 2007 -0400
@@ -4,6 +4,7 @@ all: ${PROG}
 all: ${PROG}
 
 install: ${TARG}.install
+uninstall: ${TARG}.uninstall
 clean: oneclean
 depend: ${OBJ:=.depend}
 
diff -r bf6795588403 -r 1d1998c153c3 util/compile
--- a/util/compile Mon Mar 26 01:40:47 2007 -0400
+++ b/util/compile Mon Mar 26 12:57:46 2007 -0400
@@ -11,7 +11,7 @@ status=$?
 status=$?
 
 cat $xtmp \
-| egrep -v ': error: .Each undeclared identifier|: error: for each function it appears|is dangerous, better use|is almost always misused|: In function |: At top level:|support .long long.|In file included from| from|use of C99 long long|ISO C forbids conversion' \
+| egrep -v ': error: .Each undeclared identifier|: error: for each function it appears|is dangerous, better use|is almost always misused|: In function |: At top level:|support .long long.|use of C99 long long|ISO C forbids conversion' \
 | sed 's/ .first use in this function.$//; s/\"\([^\"][^\"]*\)\", line \([0-9][0-9]*\)/\1:\2/g' \
 | uniq 1>&2
 
Received on Mon Mar 26 2007 - 19:02:47 UTC

This archive was generated by hypermail 2.2.0 : Sun Jul 13 2008 - 15:56:25 UTC