summaryrefslogtreecommitdiff
path: root/proto/common.mk
blob: 1496356ad833a033280b2377eae7587f9069c285 (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
32
33
# Copyright © 2015-2016 Luke Shumaker
# This work is free. You can redistribute it and/or modify it under the
# terms of the Do What The Fuck You Want To Public License, Version 2,
# as published by Sam Hocevar. See http://www.wtfpl.net/ for more details.

all: build
.PHONY: all

generate: $(addprefix $(srcdir)/,$(std.gen_files))
.PHONY: generate

configure: generate $(addprefix $(outdir)/,$(std.cfg_files))
.PHONY: configure

build: configure $(addprefix $(outdir)/,$(std.out_files))
.PHONY: build

install: build $(addprefix $(DESTDIR),$(std.sys_files))
.PHONY: install

maintainer-clean: private files=$(addprefix $(srcdir)/,$(std.gen_files) $(std.secondary_gen_files)) # un-generate
distclean       : private files=$(addprefix $(outdir)/,$(std.cfg_files) $(std.secondary_cfg_files)) # un-configure
clean           : private files=$(addprefix $(outdir)/,$(std.out_files) $(std.secondary_out_files)) # un-build
uninstall       : private files=$(addprefix $(DESTDIR),$(std.sys_files)                           ) # un-install

distclean: clean
maintainer-clean: distclean

clean distclean maintainer-clean uninstall:
	rm -f    -- $(sort $(filter-out %/,$(files)))
	rm -f -r -- $(sort $(filter     %/,$(files)))
	rmdir -p -- $(sort $(dir $(files))) 2>/dev/null || true
.PHONY: clean distclean maintainer-clean uninstall