-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathMakefile
46 lines (39 loc) · 1.25 KB
/
Makefile
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
prefix ?= .
INSTALLDIR ?= $(prefix)/bin
INSTALL ?= install
OS=$(shell uname -s | tr '[:upper:]' '[:lower:]')
.PHONY: all
all: src/smlpkg
.PHONY:
install: src/smlpkg
mkdir -p $(INSTALLDIR)
$(INSTALL) $< $(INSTALLDIR)/
.PHONY: test
test:
$(MAKE) -C src test
$(MAKE) -C src/test test
$(MAKE) -C pkgtests test
.PHONY: clean
clean:
$(MAKE) -C src clean
rm -rf *~ .*~ bin smlpkg-bin-*
src/smlpkg:
$(MAKE) -C src all
# -----------------------------------------------------
# Target for building binary distribution for smlpkg
# -----------------------------------------------------
BIN_DIST_DIR=smlpkg-bin-dist-$(OS)
.PHONY: bin_dist
bin_dist: src/smlpkg
rm -rf smlpkg-bin-dist-*
mkdir $(BIN_DIST_DIR)
$(MAKE) install INSTALLDIR=$(BIN_DIST_DIR)/bin/
$(INSTALL) LICENSE $(BIN_DIST_DIR)/
echo 'Binary package for smlpkg.' > $(BIN_DIST_DIR)/README
echo 'The sources are available at http://github.com/diku-dk/smlpkg' >> $(BIN_DIST_DIR)/README
echo 'PREFIX?=/usr/local' > $(BIN_DIST_DIR)/Makefile
echo 'INSTALL?=install' >> $(BIN_DIST_DIR)/Makefile
echo '.PHONY: install' >> $(BIN_DIST_DIR)/Makefile
echo 'install:' >> $(BIN_DIST_DIR)/Makefile
echo "\t"'$$(INSTALL) bin/smlpkg $$(PREFIX)/bin/' >> $(BIN_DIST_DIR)/Makefile
tar czvf $(BIN_DIST_DIR).tgz $(BIN_DIST_DIR)