BuildSystem: add BSDMakefile
This commit is contained in:
parent
eb567d9936
commit
5a05594092
1
.gitignore
vendored
1
.gitignore
vendored
@ -3,3 +3,4 @@
|
||||
wmfs
|
||||
#*
|
||||
\#*
|
||||
build
|
||||
|
||||
42
BSDmakefile
Normal file
42
BSDmakefile
Normal file
@ -0,0 +1,42 @@
|
||||
.include "config.mk"
|
||||
.include "common.mk"
|
||||
|
||||
PROG= wmfs
|
||||
MAN1= wmfs.1
|
||||
|
||||
.for lib in xrandr xinerama imlib2
|
||||
HAVE_${lib:U}!= echo ${LIBS} | grep -q ${lib} && echo -DHAVE_${lib:U}
|
||||
CFLAGS+= ${HAVE_${lib:U}}
|
||||
.endfor
|
||||
|
||||
CFLAGS_LIB!= pkg-config --cflags-only-I ${LIBS}
|
||||
LDFLAGS_LIB!= pkg-config --libs ${LIBS}
|
||||
|
||||
CFLAGS+= ${CFLAGS_LIB}
|
||||
LDADD+= ${LDFLAGS_LIB} -lpthread
|
||||
|
||||
install: all
|
||||
@echo installing executable file to ${DESTDIR}${PREFIX}/bin
|
||||
@mkdir -p ${DESTDIR}${PREFIX}/bin
|
||||
@install ${.OBJDIR}/wmfs ${DESTDIR}${PREFIX}/bin
|
||||
@echo installing manual page to ${DESTDIR}${MANPREFIX}/man1
|
||||
@mkdir -p ${DESTDIR}${MANPREFIX}/man1
|
||||
@install -m 644 ${.OBJDIR}/wmfs.1.gz ${DESTDIR}${MANPREFIX}/man1/
|
||||
@echo installing xsession file to ${DESTDIR}${PREFIX}/share/xsessions
|
||||
@install -m 644 ${.CURDIR}/wmfs.desktop ${DESTDIR}${PREFIX}/share/xsessions
|
||||
|
||||
uninstall:
|
||||
@echo removing executable file from ${DESTDIR}${PREFIX}/bin
|
||||
@rm -f ${DESTDIR}${PREFIX}/bin/wmfs
|
||||
@echo removing manual page from ${DESTDIR}${MANPREFIX}/man1
|
||||
@rm -f ${DESTDIR}${MANPREFIX}/man1/wmfs.1.gz
|
||||
@echo removing xsession file from ${DESTDIR}${PREFIX}/share/xsessions
|
||||
@rm -f ${DESTDIR}${PREFIX}/share/xsessions/wmfs.desktop
|
||||
|
||||
|
||||
.include <bsd.prog.mk>
|
||||
|
||||
.c.o: config.mk
|
||||
@if [ ! -d `dirname ${.TARGET}` ]; then mkdir -p `dirname ${.TARGET}`; fi
|
||||
@echo CC ${.IMPSRC}
|
||||
@${CC} ${CFLAGS} -c ${.IMPSRC} -o ${.TARGET}
|
||||
43
Makefile
43
Makefile
@ -1,31 +1,7 @@
|
||||
include config.mk
|
||||
include common.mk
|
||||
|
||||
SRC= \
|
||||
src/barwin.c \
|
||||
src/client.c \
|
||||
src/config.c \
|
||||
src/draw.c \
|
||||
src/event.c \
|
||||
src/ewmh.c \
|
||||
src/frame.c \
|
||||
src/getinfo.c \
|
||||
src/infobar.c \
|
||||
src/init.c \
|
||||
src/launcher.c \
|
||||
src/layout.c \
|
||||
src/menu.c \
|
||||
src/mouse.c \
|
||||
src/parse/api.c \
|
||||
src/parse/parse.c \
|
||||
src/screen.c \
|
||||
src/status.c \
|
||||
src/systray.c \
|
||||
src/tag.c \
|
||||
src/util.c \
|
||||
src/viwmfs.c \
|
||||
src/wmfs.c
|
||||
|
||||
OBJ = ${patsubst %.c,${O}/%.o,${SRC}}
|
||||
OBJ = ${patsubst %.c,${O}/%.o,${SRCS}}
|
||||
|
||||
ifneq ($(findstring xrandr, ${LIBS}),)
|
||||
CFLAGS+= -DHAVE_XRANDR
|
||||
@ -39,7 +15,13 @@ ifneq ($(findstring imlib2, ${LIBS}),)
|
||||
CFLAGS+= -DHAVE_IMLIB2
|
||||
endif
|
||||
|
||||
all: options ${O}/wmfs
|
||||
CFLAGS+= $(shell pkg-config --cflags-only-I ${LIBS})
|
||||
LDFLAGS+= $(shell pkg-config --libs ${LIBS}) -lpthread
|
||||
|
||||
all: options ${O}/wmfs ${O}/wmfs.1.gz
|
||||
|
||||
${O}/wmfs.1.gz: wmfs.1
|
||||
gzip -cn -9 $< > $@
|
||||
|
||||
${O}/%.o: %.c config.mk
|
||||
@if [ ! -d `dirname ${O}/$<` ]; then mkdir -p `dirname ${O}/$<`; fi
|
||||
@ -59,7 +41,7 @@ ${O}/wmfs: ${OBJ} config.mk src/structs.h src/wmfs.h src/parse/parse.h
|
||||
@${CC} -o $@ ${OBJ} ${LDFLAGS}
|
||||
|
||||
clean:
|
||||
@rm -f ${OBJ} wmfs
|
||||
@rm -f ${OBJ} ${O}/wmfs ${O}/wmfs.1.gz
|
||||
|
||||
install: all
|
||||
@echo installing executable file to ${DESTDIR}${PREFIX}/bin
|
||||
@ -67,7 +49,7 @@ install: all
|
||||
@install ${O}/wmfs ${DESTDIR}${PREFIX}/bin
|
||||
@echo installing manual page to ${DESTDIR}${MANPREFIX}/man1
|
||||
@mkdir -p ${DESTDIR}${MANPREFIX}/man1
|
||||
@install -m 644 wmfs.1 ${DESTDIR}${MANPREFIX}/man1/
|
||||
@install -m 644 ${O}/wmfs.1.gz ${DESTDIR}${MANPREFIX}/man1/
|
||||
@echo installing xsession file to ${DESTDIR}${PREFIX}/share/xsessions
|
||||
@install -m 644 wmfs.desktop ${DESTDIR}${PREFIX}/share/xsessions
|
||||
|
||||
@ -75,10 +57,11 @@ uninstall:
|
||||
@echo removing executable file from ${DESTDIR}${PREFIX}/bin
|
||||
@rm -f ${DESTDIR}${PREFIX}/bin/wmfs
|
||||
@echo removing manual page from ${DESTDIR}${MANPREFIX}/man1
|
||||
@rm -f ${DESTDIR}${MANPREFIX}/man1/wmfs.1
|
||||
@rm -f ${DESTDIR}${MANPREFIX}/man1/wmfs.1.gz
|
||||
@echo removing xsession file from ${DESTDIR}${PREFIX}/share/xsessions
|
||||
@rm -f ${DESTDIR}${PREFIX}/share/xsessions/wmfs.desktop
|
||||
|
||||
|
||||
|
||||
.PHONY: all clean install uninstall
|
||||
|
||||
|
||||
31
common.mk
Normal file
31
common.mk
Normal file
@ -0,0 +1,31 @@
|
||||
SRCS= \
|
||||
src/barwin.c \
|
||||
src/client.c \
|
||||
src/config.c \
|
||||
src/draw.c \
|
||||
src/event.c \
|
||||
src/ewmh.c \
|
||||
src/frame.c \
|
||||
src/getinfo.c \
|
||||
src/infobar.c \
|
||||
src/init.c \
|
||||
src/launcher.c \
|
||||
src/layout.c \
|
||||
src/menu.c \
|
||||
src/mouse.c \
|
||||
src/parse/api.c \
|
||||
src/parse/parse.c \
|
||||
src/screen.c \
|
||||
src/status.c \
|
||||
src/systray.c \
|
||||
src/tag.c \
|
||||
src/util.c \
|
||||
src/viwmfs.c \
|
||||
src/wmfs.c
|
||||
|
||||
# flags
|
||||
CFLAGS= -Wall -DXDG_CONFIG_DIR=\"${XDG_CONFIG_DIR}\"
|
||||
CFLAGS+= -DWMFS_VERSION=\"${VERSION}\"
|
||||
|
||||
# build directory
|
||||
O?= build
|
||||
@ -10,11 +10,3 @@ PREFIX= /usr/local
|
||||
MANPREFIX= ${PREFIX}/share/man
|
||||
XDG_CONFIG_DIR= /usr/local/etc/xdg/wmfs
|
||||
|
||||
# flags
|
||||
CFLAGS= -Wall -DXDG_CONFIG_DIR=\"${XDG_CONFIG_DIR}\"
|
||||
CFLAGS+= $(shell pkg-config --cflags-only-I ${LIBS})
|
||||
LDFLAGS= $(shell pkg-config --libs ${LIBS}) -lpthread
|
||||
CFLAGS+= -DWMFS_VERSION=\"${VERSION}\"
|
||||
|
||||
CC = cc
|
||||
O = __build__
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user