~steef/snixembed

snixembed/makefile -rw-r--r-- 878 bytes
95bf8820Steef Hegeman version 0.3.1 14 days ago
                                                                                
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
32
PKG = gtk+-3.0 gio-2.0 Dbusmenu-0.4 DbusmenuGtk3-0.4
CPKG = dbusmenu-gtk3-0.4
SRC = src/*.vala version.vala

PREFIX ?= /usr
BINDIR ?= /bin

PKG := $(foreach pkg, $(PKG), --pkg $(pkg))
CFLAGS := $(CFLAGS) $(shell pkg-config --cflags --libs $(CPKG))
VFLAGS := $(foreach flag, $(CFLAGS), -X $(flag)) $(VFLAGS)

snixembed: $(SRC)
	valac -o $@ $(VFLAGS) $(PKG) $(SRC)

version.vala: # update version from git if possible
ifneq (,$(wildcard ./.git/HEAD))
	echo "const string VERSION = \"$(shell git describe --always --tags --dirty)\";" > $@
endif

doc: $(SRC)
	valadoc --force -o $@ --internal --private --package-name snixembed $(SRC) $(PKG)

clean:
	rm -rf src/*.c version.vala snixembed doc

install: snixembed
	install -Dm755 snixembed $(DESTDIR)$(PREFIX)$(BINDIR)/snixembed

uninstall:
	rm -f $(DESTDIR)$(PREFIX)$(BINDIR)/snixembed

.PHONY: clean install uninstall version.vala