summaryrefslogtreecommitdiff
path: root/Makefile
blob: 8dc82458eccd5b4c0f13565e9075683b5e7d07fd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
CC           ?= clang
CFLAGS       := -std=c99 -pedantic -Wall -Wextra -Wunused -Wswitch-enum
INCLUDES     := $(shell pkg-config --cflags xft libpulse)
LDFLAGS      := $(shell pkg-config --libs x11 xft libpulse) -lpthread
DESTDIR      ?= /usr/local
DISPLAY_NUM  := 69

ifdef DEBUG
	CFLAGS += -ggdb -DDEBUG
endif

ifdef OPTIMIZE
	CFLAGS += -O$(OPTIMIZE)
endif

all: glitch

glitch: main.c logging.c manager.c widgets.c switcher.c audio.c launcher.c
	$(CC) $(CFLAGS) $(INCLUDES) -o $@ $^ $(LDFLAGS)

config.h:
	[ -f config.h ] || cp config.def.h config.h

install: all
	install -Dm755 glitch $(DESTDIR)/bin/glitch

clean:
	rm -f glitch

virt:
	Xephyr -br -ac -noreset -no-host-grab -sw-cursor -screen 1000x1000 :$(DISPLAY_NUM)