xcwd/Makefile

37 lines
609 B
Makefile
Raw Normal View History

2013-04-24 21:05:53 +02:00
CFILES=xcwd.c
CC=gcc
2013-07-01 23:09:33 +02:00
CFLAGS=-Wall -Werror -Wextra -std=gnu99 -O2
2013-04-24 21:05:53 +02:00
LDFLAGS=-lX11
EXE="xcwd"
prefix=/usr/
2013-07-01 23:09:33 +02:00
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
2013-04-24 21:05:53 +02:00
${EXE}: clean ${O}
2013-04-26 01:11:46 +02:00
${CC} -o $@ ${O} ${CFLAGS} ${LDFLAGS}
2013-04-24 21:05:53 +02:00
.SUFFIXES: .c .o
.c.o:
2013-04-25 18:00:41 +02:00
${CC} -c $< ${CFLAGS}
2013-04-24 21:05:53 +02:00
clean:
rm -vf *.o
distclean: clean
rm -vf ${EXE}
install: ${EXE}
install -m 0755 ${EXE} $(prefix)/bin