summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'sys-apps/setarch/files/Makefile')
-rw-r--r--sys-apps/setarch/files/Makefile24
1 files changed, 24 insertions, 0 deletions
diff --git a/sys-apps/setarch/files/Makefile b/sys-apps/setarch/files/Makefile
new file mode 100644
index 000000000000..ba22b66b4a9a
--- /dev/null
+++ b/sys-apps/setarch/files/Makefile
@@ -0,0 +1,24 @@
+bindir = /bin
+mandir = /usr/share/man
+
+RM = rm -f
+LN_S = ln -s
+
+all: setarch links
+
+setarch.i: setarch.c
+ $(CC) $(CFLAGS) -E $< -o $@
+links: setarch.i Makefile
+ LC_ALL=C sed -n '/{PER_LINUX.* ,$$/{s:[^"]*, ::;s:,.*::;s:"::g;p}' $< > links
+
+install: setarch
+ mkdir -p $(DESTDIR)$(bindir) $(DESTDIR)$(mandir)/man8
+ install -m755 setarch $(DESTDIR)$(bindir)
+ install -m644 setarch.8 $(DESTDIR)$(mandir)/man8
+ for x in `cat links` ; do \
+ $(LN_S) setarch $(DESTDIR)$(bindir)/$$x || exit 1 ; \
+ $(LN_S) setarch.8 $(DESTDIR)$(mandir)/man8/$$x || exit 1 ; \
+ done
+
+clean:
+ $(RM) setarch setarch.i links