summary refs log tree commit diff
diff options
context:
space:
mode:
authorChristian Neukirchen <chneukirchen@gmail.com>2010-02-21 19:15:27 +0100
committerChristian Neukirchen <chneukirchen@gmail.com>2010-02-21 19:15:27 +0100
commit50aff37f501046982d544383219f8b90c0bb2498 (patch)
treee2ee369535b3d363b98f25ef15543118fafe723e
parent507480a69503bd3a5924ebd8cc2e9a971efe62d9 (diff)
downloadcwm-50aff37f501046982d544383219f8b90c0bb2498.tar.gz
cwm-50aff37f501046982d544383219f8b90c0bb2498.tar.xz
cwm-50aff37f501046982d544383219f8b90c0bb2498.zip
Import linux.patch
Patch largely based on cwmbuild.sh from http://tamentis.com/hacks/cwm/
written by Bertrand Janin, updated by Christian Neukirchen.
-rw-r--r--Makefile38
-rw-r--r--calmwm.h4
-rw-r--r--xevents.c1
3 files changed, 38 insertions, 5 deletions
diff --git a/Makefile b/Makefile
index 1576e77..b4b97fd 100644
--- a/Makefile
+++ b/Makefile
@@ -1,14 +1,23 @@
 # $OpenBSD$
 
-.include <bsd.xconf.mk>
+#.include <bsd.xconf.mk>
 
 PROG=		cwm
 
+BINDIR=		/usr/bin
+
 SRCS=		calmwm.c screen.c xmalloc.c client.c menu.c \
 		search.c util.c xutil.c conf.c input.c xevents.c group.c \
 		kbfunc.c mousefunc.c font.c parse.y
 
-CPPFLAGS+=	-I${X11BASE}/include -I${X11BASE}/include/freetype2 -I${.CURDIR}
+OBJS=		calmwm.o screen.o xmalloc.o client.o menu.o \
+		search.o util.o xutil.o conf.o input.o xevents.o group.o \
+		kbfunc.o mousefunc.o font.o strlcpy.o strlcat.o y.tab.o \
+		strtonum.o fgetln.o
+
+X11BASE=	/usr
+
+CPPFLAGS+=	-I${X11BASE}/include -I${X11BASE}/include/freetype2 -I.
 
 CFLAGS+=	-Wall
 
@@ -20,7 +29,26 @@ MAN=		cwm.1 cwmrc.5
 
 CLEANFILES=	cwm.cat1 cwmrc.cat5
 
-obj: _xenocara_obj
 
-.include <bsd.prog.mk>
-.include <bsd.xorg.mk>
+all: $(PROG)
+
+clean:
+	rm -rf $(OBJS) $(PROG) y.tab.c
+
+y.tab.c: parse.y
+	byacc parse.y
+
+
+$(PROG): $(OBJS) y.tab.o
+	$(CC) $(OBJS) ${LDADD} -o ${PROG}
+
+$(OBJS): %.o: %.c
+	$(CC) -c $(CFLAGS) $(CPPFLAGS) $<
+
+install: ${PROG}
+	install -m 755 cwm /usr/local/bin/
+	install -m 644 cwm.1 /usr/local/man/man1
+	install -m 644 cwmrc.5 /usr/local/man/man5
+
+#.include <bsd.prog.mk>
+#.include <bsd.xorg.mk>
diff --git a/calmwm.h b/calmwm.h
index bb25ea6..810dd4b 100644
--- a/calmwm.h
+++ b/calmwm.h
@@ -21,6 +21,10 @@
 #ifndef _CALMWM_H_
 #define _CALMWM_H_
 
+/* ugly stuff */
+#define TAILQ_END(head) NULL
+#define __dead
+
 #include <X11/Xatom.h>
 #include <X11/Xft/Xft.h>
 #include <X11/Xlib.h>
diff --git a/xevents.c b/xevents.c
index 22c2afc..9681790 100644
--- a/xevents.c
+++ b/xevents.c
@@ -29,6 +29,7 @@
 
 #include <err.h>
 #include <errno.h>
+#include <signal.h>
 #include <stdlib.h>
 #include <string.h>
 #include <stdio.h>