summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Adrien Schildknecht <adrien+dev@schischi.me>2013-07-01 23:09:33 +0200
committerGravatar Adrien Schildknecht <adrien+dev@schischi.me>2013-07-02 02:27:45 +0200
commit497ee173450e459b088cf86ee5ece4f654515c48 (patch)
tree5f07560cd76f27dc431dfe4cd95ff6ff608da643
parenteed4fd22c1c29f6cd4a20ec5b3b26d98a829e3d0 (diff)
Makefile: add Freebsd cflags/ldflags
-rw-r--r--Makefile16
1 files changed, 14 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 15b6b80..59c94c5 100644
--- a/Makefile
+++ b/Makefile
@@ -1,10 +1,22 @@
CFILES=xcwd.c
CC=gcc
-CFLAGS=-Wall -Werror -Wextra -pedantic -std=gnu99 -O2
+CFLAGS=-Wall -Werror -Wextra -std=gnu99 -O2
LDFLAGS=-lX11
EXE="xcwd"
-O=${CFILES:.c=.o}
prefix=/usr/
+UNAME:=$(shell uname)
+O=${CFILES:.c=.o}
+
+ifeq ($(UNAME), Linux)
+ CFLAGS += -DLINUX
+else
+ ifeq ($(UNAME), FreeBSD)
+ CFLAGS += -I/usr/local/include/ -DFREEBSD
+ LDFLAGS += -L/usr/local/lib -lprocstat
+ else
+ $(error Operating System not supported.)
+ endif
+endif
${EXE}: clean ${O}
${CC} -o $@ ${O} ${CFLAGS} ${LDFLAGS}