monsterwm

Personal build of monsterwm
git clone git://git.gormless.xyz/monsterwm.git
Log | Files | Refs | README | LICENSE

Makefile (1546B)


      1 # Makefile for monsterwm - see LICENSE for license and copyright information
      2 
      3 VERSION = cookies-git
      4 WMNAME  = monsterwm
      5 
      6 PREFIX ?= /usr/local
      7 BINDIR ?= ${PREFIX}/bin
      8 MANPREFIX = ${PREFIX}/share/man
      9 
     10 X11INC = -I/usr/X11R6/include
     11 X11LIB = -L/usr/X11R6/lib -lX11
     12 
     13 INCS = -I. -I/usr/include ${X11INC}
     14 LIBS = -L/usr/lib -lc ${X11LIB}
     15 
     16 CFLAGS   = -std=c99 -pedantic -Wall -Wextra ${INCS} -DVERSION=\"${VERSION}\"
     17 LDFLAGS  = ${LIBS}
     18 
     19 CC 	 = cc
     20 EXEC = ${WMNAME}
     21 
     22 SRC = ${WMNAME}.c
     23 OBJ = ${SRC:.c=.o}
     24 
     25 all: CFLAGS += -Os
     26 all: LDFLAGS += -s
     27 all: options ${WMNAME}
     28 
     29 debug: CFLAGS += -O0 -g
     30 debug: options ${WMNAME}
     31 
     32 options:
     33 	@echo ${WMNAME} build options:
     34 	@echo "CFLAGS   = ${CFLAGS}"
     35 	@echo "LDFLAGS  = ${LDFLAGS}"
     36 	@echo "CC       = ${CC}"
     37 
     38 .c.o:
     39 	@echo CC $<
     40 	@${CC} -c ${CFLAGS} $<
     41 
     42 ${OBJ}: config.h
     43 
     44 config.h:
     45 	@echo creating $@ from config.def.h
     46 	@cp config.def.h $@
     47 
     48 ${WMNAME}: ${OBJ}
     49 	@echo CC -o $@
     50 	@${CC} -o $@ ${OBJ} ${LDFLAGS}
     51 
     52 clean:
     53 	@echo cleaning
     54 	@rm -fv ${WMNAME} ${OBJ} ${WMNAME}-${VERSION}.tar.gz
     55 
     56 install: all
     57 	@echo installing executable file to ${DESTDIR}${PREFIX}/bin
     58 	@install -Dm755 ${WMNAME} ${DESTDIR}${PREFIX}/bin/${WMNAME}
     59 	@echo installing manual page to ${DESTDIR}${MANPREFIX}/man.1
     60 	@install -Dm644 ${WMNAME}.1 ${DESTDIR}${MANPREFIX}/man1/${WMNAME}.1
     61 
     62 uninstall:
     63 	@echo removing executable file from ${DESTDIR}${PREFIX}/bin
     64 	@rm -f ${DESTDIR}${PREFIX}/bin/${WMNAME}
     65 	@echo removing manual page from ${DESTDIR}${MANPREFIX}/man1
     66 	@rm -f ${DESTDIR}${MANPREFIX}/man1/${WMNAME}.1
     67 
     68 .PHONY: all options clean install uninstall