summaryrefslogtreecommitdiffstats
path: root/Makefile.in
blob: c2c1e8b1316537374a5bc7a94ca59bace38bb1b8 (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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
# opkhelper
# Makefile.in
# Input Makefile for configure.
#
# Copyright (C) 2012 Patrick "P. J." McDermott
#
# This program 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.
#
# This program 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 this program.  If not, see <http://www.gnu.org/licenses/>.

SHELL = @shell@
INSTALL = @install@

SRCDIR = @srcdir@
PREFIX = @prefix@
BINDIR = @bindir@
LIBDIR = @libdir@
MANDIR = @mandir@

.SUFFIXES:

OBJS = lib/controlfields src/opkbuild \
       src/oh-strip src/oh-installfiles src/oh-gencontrol src/oh-buildopk \

.PHONY: all
all: $(OBJS)

src lib:
	@printf '  Making directories...\n'
	@mkdir src lib

sedscript:
	@printf '  Writing sed script...\n'
	@echo 's&@@BINDIR@@&$(BINDIR)&' > sedscript
	@echo 's&@@LIBDIR@@&$(LIBDIR)&' >> sedscript

$(OBJS): src lib sedscript
	@printf '  SED $@\n'
	@sed -f sedscript $(SRCDIR)/$@ > $@

.PHONY: clean
clean:
	rm -Rf src lib sedscript

.PHONY: install
install: all
	@printf '  INSTALL src/opkbuild\n'
	@$(INSTALL) -D "src/opkbuild" "$(DESTDIR)/$(BINDIR)/opkbuild"
	@printf '  INSTALL src/oh-strip\n'
	@$(INSTALL) -D "src/oh-strip" "$(DESTDIR)/$(BINDIR)/oh-strip"
	@printf '  INSTALL src/oh-installfiles\n'
	@$(INSTALL) -D "src/oh-installfiles" "$(DESTDIR)/$(BINDIR)/oh-installfiles"
	@printf '  INSTALL src/oh-buildopk\n'
	@$(INSTALL) -D "src/oh-buildopk" "$(DESTDIR)/$(BINDIR)/oh-buildopk"
	@printf '  INSTALL lib/controlfields\n'
	@$(INSTALL) -D "lib/controlfields" \
		"$(DESTDIR)/$(LIBDIR)/opkhelper/controlfields"
	@printf '  INSTALL man/opkbuild.1\n'
	@$(INSTALL) -D "$(SRCDIR)/man/opkbuild.1" \
		"$(DESTDIR)/$(MANDIR)/man1/opkbuild.1"
	@printf '  INSTALL man/oh-strip.1\n'
	@$(INSTALL) -D "$(SRCDIR)/man/oh-strip.1" \
		"$(DESTDIR)/$(MANDIR)/man1/oh-strip.1"
	@printf '  INSTALL man/oh-installfiles.1\n'
	@$(INSTALL) -D "$(SRCDIR)/man/oh-installfiles.1" \
		"$(DESTDIR)/$(MANDIR)/man1/oh-installfiles.1"
	@printf '  INSTALL man/oh-gencontrol.1\n'
	@$(INSTALL) -D "$(SRCDIR)/man/oh-gencontrol.1" \
		"$(DESTDIR)/$(MANDIR)/man1/oh-gencontrol.1"
	@printf '  INSTALL man/oh-buildopk.1\n'
	@$(INSTALL) -D "$(SRCDIR)/man/oh-buildopk.1" \
		"$(DESTDIR)/$(MANDIR)/man1/oh-buildopk.1"

.PHONY: uninstall
uninstall:
	@printf '  RM opkbuild\n'
	@rm -f "$(DESTDIR)/$(BINDIR)/opkbuild"
	@printf '  RM oh-strip\n'
	@rm -f "$(DESTDIR)/$(BINDIR)/oh-strip"
	@printf '  RM oh-installfiles\n'
	@rm -f "$(DESTDIR)/$(BINDIR)/oh-installfiles"
	@printf '  RM oh-buildopk\n'
	@rm -f "$(DESTDIR)/$(BINDIR)/oh-buildopk"
	@printf '  RM controlfields\n'
	@rm -f "$(DESTDIR)/$(LIBDIR)/opkhelper/controlfields"
	@printf '  RM opkbuild.1\n'
	@rm -f "$(DESTDIR)/$(MANDIR)/man1/opkbuild.1"
	@printf '  RM oh-strip.1\n'
	@rm -f "$(DESTDIR)/$(MANDIR)/man1/oh-strip.1"
	@printf '  RM oh-installfiles.1\n'
	@rm -f "$(DESTDIR)/$(MANDIR)/man1/oh-installfiles.1"
	@printf '  RM oh-gencontrol.1\n'
	@rm -f "$(DESTDIR)/$(MANDIR)/man1/oh-gencontrol.1"
	@printf '  RM oh-buildopk.1\n'
	@rm -f "$(DESTDIR)/$(MANDIR)/man1/oh-buildopk.1"