X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=Makefile;h=ecfc7db16da678ff5b8050473c171ff6c555bd4b;hb=caed86119088f6163052775b2ac3bf74df838a0d;hp=862693e5ef86a9da16fab4acd50ca951f0f1d5fb;hpb=3f8979ace8778470fb372f27258e0b11d189c55c;p=bspwm.git diff --git a/Makefile b/Makefile index 862693e..ecfc7db 100644 --- a/Makefile +++ b/Makefile @@ -1,58 +1,61 @@ -VERSION = 0.01 +VERSION = 0.2 CC = gcc -LIBS = `pkg-config --libs xcb xcb-ewmh lua` -CFLAGS = -g -std=c99 -pedantic -Wall -Wextra +LIBS = -lm -lxcb -lxcb-icccm -lxcb-ewmh -lxcb-xinerama +CFLAGS = -std=c99 -pedantic -Wall -Wextra -DVERSION=\"$(VERSION)\" LDFLAGS = $(LIBS) -PREFIX = /usr/local +PREFIX ?= /usr/local BINPREFIX = $(PREFIX)/bin +MANPREFIX = $(PREFIX)/share/man -WM_SRC = bspwm.c events.c luautils.c messages.c ewmh.c settings.c utils.c tree.c types.c -CL_SRC = bspc.c -ST_SRC = bsps.c +WM_SRC = bspwm.c events.c messages.c ewmh.c settings.c helpers.c tree.c types.c rules.c window.c +CL_SRC = bspc.c helpers.c WM_OBJ = $(WM_SRC:.c=.o) CL_OBJ = $(CL_SRC:.c=.o) -ST_OBJ = $(ST_SRC:.c=.o) -all: options clean bspwm bspc bsps +all: CFLAGS += -Os +all: LDFLAGS += -s +all: options bspwm bspc + +debug: CFLAGS += -O0 -g -DDEBUG +debug: options bspwm bspc options: -# @echo "bspwm build options:" -# @echo "CC = $(CC)" -# @echo "CFLAGS = $(CFLAGS)" -# @echo "LDFLAGS = $(LDFLAGS)" -# @echo "PREFIX = $(PREFIX)" + @echo "bspwm build options:" + @echo "CC = $(CC)" + @echo "CFLAGS = $(CFLAGS)" + @echo "LDFLAGS = $(LDFLAGS)" + @echo "PREFIX = $(PREFIX)" .c.o: -# @echo "CC $<" + @echo "CC $<" @$(CC) $(CFLAGS) -DVERSION=\"$(VERSION)\" -c -o $@ $< -bspwm: $(WM_OBJ) -# @echo CC -o $@ +bspwm: $(WM_OBJ) + @echo CC -o $@ @$(CC) -o $@ $(WM_OBJ) $(LDFLAGS) -bsps: $(ST_OBJ) -# @echo CC -o $@ - @$(CC) -o $@ $(ST_OBJ) $(LDFLAGS) - -bspc: $(CL_OBJ) -# @echo CC -o $@ +bspc: $(CL_OBJ) + @echo CC -o $@ @$(CC) -o $@ $(CL_OBJ) $(LDFLAGS) clean: -# @echo "cleaning" - @rm -f $(WM_OBJ) $(CL_OBJ) bsp{wm,c,s} + @echo "cleaning" + @rm -f $(WM_OBJ) $(CL_OBJ) bsp{wm,c} -install: all -# @echo "installing executable files to $(DESTDIR)$(BINPREFIX)" +install: + @echo "installing executable files to $(DESTDIR)$(BINPREFIX)" @install -D -m 755 bspwm $(DESTDIR)$(BINPREFIX)/bspwm @install -D -m 755 bspc $(DESTDIR)$(BINPREFIX)/bspc - @install -D -m 755 bsps $(DESTDIR)$(BINPREFIX)/bsps + @echo "installing manual page to $(DESTDIR)$(MANPREFIX)/man1" + @install -D -m 644 bspwm.1 $(DESTDIR)$(MANPREFIX)/man1/bspwm.1 uninstall: -# @echo "removing executable files from $(DESTDIR)$(BINPREFIX)" - @rm -f $(DESTDIR)$(BINPREFIX)/bsp{wm,c,s} + @echo "removing executable files from $(DESTDIR)$(BINPREFIX)" + @rm -f $(DESTDIR)$(BINPREFIX)/bsp{wm,c} + @echo "removing manual page from $(DESTDIR)$(MANPREFIX)/man1" + @rm -f $(DESTDIR)$(MANPREFIX)/man1/bspwm.1 -.PHONY: all options clean install uninstall +.PHONY: all debug options clean install uninstall