Annotation of /trunk/mage/Makefile
Parent Directory | Revision Log
Revision 3178 -
(hide annotations)
(download)
Mon Jul 31 09:05:47 2023 UTC (9 months, 1 week ago) by niro
File size: 3509 byte(s)
Mon Jul 31 09:05:47 2023 UTC (9 months, 1 week ago) by niro
File size: 3509 byte(s)
-new x86_64 lib layout lib/lib32 and honor abis specific libdir/chost with mlibdir() and CHOST
1 | niro | 363 | # Magellan Package Management |
2 | niro | 2228 | # $Id$ |
3 | niro | 363 | |
4 | niro | 2226 | VERSION = $(shell cat VERSION) |
5 | niro | 3048 | ARCH = $(shell arch) |
6 | niro | 363 | |
7 | niro | 3178 | ABI_X86_64_CHOST = x86_64-pc-linux-gnu |
8 | ABI_X86_CHOST = i686-pc-linux-gnu | ||
9 | |||
10 | niro | 1678 | ifeq ($(ARCH), x86_64) |
11 | niro | 3034 | MARCH = x86-64 |
12 | niro | 3178 | ABI_DEFAULT_LIBDIR = lib |
13 | ABI_X86_64_LIBDIR = lib | ||
14 | ABI_X86_LIBDIR = lib32 | ||
15 | ABI_DEFAULT_CHOST = $(ABI_X86_64_CHOST) | ||
16 | niro | 1678 | else |
17 | niro | 3034 | MARCH = $(ARCH) |
18 | niro | 3178 | ABI_DEFAULT_LIBDIR = lib |
19 | ABI_X86_64_LIBDIR = lib | ||
20 | ABI_X86_LIBDIR = lib | ||
21 | ABI_DEFAULT_CHOST = $(ABI_X86_CHOST) | ||
22 | niro | 1678 | endif |
23 | niro | 3034 | MTUNE = generic |
24 | niro | 1678 | |
25 | niro | 2226 | sysconfdir = /etc |
26 | libdir = /usr/lib/mage | ||
27 | sbindir = /sbin | ||
28 | datadir = /usr/share/doc/mage-$(VERSION) | ||
29 | niro | 363 | |
30 | niro | 2226 | srcdir = . |
31 | srclib = $(srcdir)/usr/lib/mage | ||
32 | srcdoc = $(srcdir)/usr/share/doc/mage | ||
33 | srcetc = $(srcdir)/etc | ||
34 | niro | 363 | |
35 | all: install | ||
36 | |||
37 | create-dirs: | ||
38 | install -d -m 0755 $(DESTDIR)$(sysconfdir) | ||
39 | install -d -m 0755 $(DESTDIR)$(libdir) | ||
40 | install -d -m 0755 $(DESTDIR)$(sbindir) | ||
41 | install -d -m 0755 $(DESTDIR)$(datadir) | ||
42 | |||
43 | install-files: | ||
44 | niro | 368 | install -m 0644 $(srcdir)/etc/etc-update.conf $(DESTDIR)$(sysconfdir) |
45 | install -m 0644 $(srcdir)/etc/mage.rc.example $(DESTDIR)$(sysconfdir) | ||
46 | niro | 363 | install -m 0755 $(srclib)/compressdoc $(DESTDIR)$(libdir) |
47 | install -m 0755 $(srclib)/create_desktop_app.sh $(DESTDIR)$(libdir) | ||
48 | install -m 0755 $(srclib)/depwalker.sh $(DESTDIR)$(libdir) | ||
49 | install -m 0755 $(srclib)/env-rebuild.sh $(DESTDIR)$(libdir) | ||
50 | install -m 0755 $(srclib)/etc-update $(DESTDIR)$(libdir) | ||
51 | install -m 0644 $(srclib)/mage4.functions.sh $(DESTDIR)$(libdir) | ||
52 | install -m 0755 $(srclib)/mage4.sh $(DESTDIR)$(libdir) | ||
53 | install -m 0755 $(srclib)/magequery.sh $(DESTDIR)$(libdir) | ||
54 | niro | 1678 | sed -e "s:@@ARCH@@:$(ARCH):g" \ |
55 | -e "s:@@MTUNE@@:$(MTUNE):g" \ | ||
56 | niro | 3034 | -e "s:@@MARCH@@:$(MARCH):g" \ |
57 | niro | 3178 | -e "s:@@MAGE_ABI_DEFAULT_LIBDIR@@:$(MAGE_ABI_DEFAULT_LIBDIR):g" \ |
58 | -e "s:@@MAGE_ABI_X86_LIBDIR@@:$(MAGE_ABI_X86_LIBDIR):g" \ | ||
59 | -e "s:@@MAGE_ABI_X86_64_LIBDIR@@:$(MAGE_ABI_X86_64_LIBDIR):g" \ | ||
60 | -e "s:@@ABI_DEFAULT_CHOST@@:$(ABI_DEFAULT_CHOST):g" \ | ||
61 | -e "s:@@ABI_X86_64_CHOST@@:$(ABI_X86_64_CHOST):g" \ | ||
62 | -e "s:@@ABI_X86_CHOST@@:$(ABI_X86_CHOST):g" \ | ||
63 | niro | 1678 | $(srclib)/mage.rc.global.in \ |
64 | niro | 1606 | > $(DESTDIR)$(libdir)/mage.rc.global |
65 | niro | 363 | install -m 0755 $(srclib)/mgroupadd $(DESTDIR)$(libdir) |
66 | install -m 0755 $(srclib)/mgroupdel $(DESTDIR)$(libdir) | ||
67 | install -m 0755 $(srclib)/mkinfodir $(DESTDIR)$(libdir) | ||
68 | install -m 0755 $(srclib)/museradd $(DESTDIR)$(libdir) | ||
69 | install -m 0755 $(srclib)/muserdel $(DESTDIR)$(libdir) | ||
70 | install -m 0755 $(srclib)/pkgbuild_dir.sh $(DESTDIR)$(libdir) | ||
71 | install -m 0755 $(srclib)/smage2.sh $(DESTDIR)$(libdir) | ||
72 | niro | 1640 | install -m 0644 $(srclib)/smage2.functions.sh $(DESTDIR)$(libdir) |
73 | niro | 363 | install -m 0644 $(srcdoc)/template.{mage,smage2} $(DESTDIR)$(datadir) |
74 | niro | 1442 | install -m 0644 $(srcdir)/ChangeLog $(DESTDIR)$(datadir) |
75 | niro | 1439 | echo "$(VERSION)" > $(DESTDIR)$(libdir)/version |
76 | niro | 363 | |
77 | niro | 1643 | # include some useful scripts |
78 | install -m 0755 $(srclib)/ldd-fix.sh $(DESTDIR)$(libdir) | ||
79 | install -m 0755 $(srclib)/pkg_all_sources.sh $(DESTDIR)$(libdir) | ||
80 | install -m 0755 $(srclib)/autodepend.sh $(DESTDIR)$(libdir) | ||
81 | install -m 0755 $(srclib)/search_soname.sh $(DESTDIR)$(libdir) | ||
82 | |||
83 | niro | 363 | install-symlinks: |
84 | ln -snf $(libdir)/mage4.sh $(DESTDIR)$(sbindir)/mage | ||
85 | ln -snf $(libdir)/smage2.sh $(DESTDIR)$(sbindir)/smage2 | ||
86 | ln -snf $(libdir)/env-rebuild.sh $(DESTDIR)$(sbindir)/env-rebuild | ||
87 | ln -snf $(libdir)/compressdoc $(DESTDIR)$(sbindir)/compressdoc | ||
88 | ln -snf $(libdir)/etc-update $(DESTDIR)$(sbindir)/etc-update | ||
89 | ln -snf $(libdir)/magequery.sh $(DESTDIR)$(sbindir)/magequery | ||
90 | ln -snf $(libdir)/mage.rc.global $(DESTDIR)$(sysconfdir)/mage.rc.global | ||
91 | |||
92 | install: create-dirs \ | ||
93 | install-files \ | ||
94 | install-symlinks | ||
95 | |||
96 | .PHONY: all install |