aboutsummaryrefslogtreecommitdiffstats
path: root/src/Makefile
blob: aae7c04c88e92b46134159af0776cde355366fd7 (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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# Copyright (C) 2012, 2013 Tom Willemsen
#
#   This file is part of Markam
#
#   Markam is free software: you can redistribute it and/or modify it
#   under the terms of the GNU General Public License as published by
#   the Free Software Foundation, either version 3 of the License, or
#   (at your option) any later version.
#
#   Markam is distributed in the hope that it will be useful, but
#   WITHOUT ANY WARRANTY; without even the implied warranty of
#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
#   General Public License for more details.
#
#   You should have received a copy of the GNU General Public License
#   along with Markam. If not, see <http://www.gnu.org/licenses/>.
DESTDIR ?= /usr/local
CSC = csc

binaries = markam markam-convert
install-binaries = $(addprefix install-,$(binaries))
uninstall-binaries = $(addprefix uninstall-,$(binaries))
objects = paths.o common.o

.PHONY: all install $(install-binaries) uninstall $(uninstall-binaries) \
	install-strip

all: $(binaries)
install: $(install-binaries)
uninstall: $(uninstall-binaries)
install-strip:
	$(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' install

markam: markam.scm $(objects)
	$(CSC) $^ -o $@

markam-convert: markam-convert.scm $(objects)
	$(CSC) $^ -o $@

$(install-binaries): install-%: %
	$(INSTALL_PROGRAM) $* "$(DESTDIR)/bin/$*"

$(uninstall-binaries): uninstall-%:
	rm -f "$(DESTDIR)/bin/$*"

$(objects): %.o: %.scm
	$(CSC) -c $^