]> Git Repo - uclibc-ng.git/blame - debian/rules
Fix SYSTEM_DEVEL_PREFIX to allow install of the <arch>-uclibc- spoofer
[uclibc-ng.git] / debian / rules
CommitLineData
4d5c35c0
DS
1#!/usr/bin/make -f
2# Sample debian/rules that uses debhelper.
3# GNU copyright 1997 to 1999 by Joey Hess.
4
5# Uncomment this to turn on verbose mode.
6#export DH_VERBOSE=1
7
8# This is the debhelper compatability version to use.
9export DH_COMPAT=1
10
11#include version
12major=$(shell grep '^MAJOR_VERSION' Rules.mak|sed 's/.*=//')
13minor=$(shell grep '^MINOR_VERSION' Rules.mak|sed 's/.*=//')
14version:=$(strip $(major)).$(strip $(minor))
15
16target=$(DEB_HOST_GNU_CPU)
17#target=powerpc
18
ca240d0e
DS
19with_shared_libs=y
20#ifeq ($(target),powerpc)
21#with_shared_libs=n
22#endif
23
93c8ab68
DS
24ifneq ($(target),$(DEB_HOST_GNU_CPU))
25target_suffix=-$(target)
26endif
27
28p_dev=libuclibc-dev$(target_suffix)
29p_lib=libuclibc0$(target_suffix)
f0446fcb 30p_gcc=uclibc$(target_suffix)-toolchain
93c8ab68 31
d00f43f9 32debian/control: debian/control.in debian/rules
93c8ab68 33 sed s/_TARGET_/$(target_suffix)/ debian/control.in >debian/control
ca240d0e 34
4d5c35c0 35build: build-stamp
d00f43f9 36build-stamp: debian/control
4d5c35c0
DS
37 dh_testdir
38
39 # Add here commands to compile the package.
6d4acfb1 40 cp extra/Configs/Config.$(target) Config
4d5c35c0
DS
41
42 echo '#Debian configuration overrides' >>Config
3f9dec7f 43ifneq ($(target),$(DEB_HOST_GNU_CPU))
4d5c35c0
DS
44 echo 'TARGET_ARCH = $(target)' >>Config
45 echo 'CROSS = $(target)-linux-' >>Config
46endif
47 echo 'DOPIC = true' >>Config
24700c28 48 echo 'SYSTEM_DEVEL_PREFIX = /usr' >>Config
f0446fcb
DS
49 echo 'DEVEL_PREFIX = /usr/$$(TARGET_ARCH)-linux-uclibc' >>Config
50 echo 'SHARED_LIB_LOADER_PATH = /lib' >>Config
51 #echo 'TARGET_PREFIX = /' >>Config
ca240d0e 52ifeq ($(with_shared_libs),n)
3f9dec7f
DS
53 echo 'HAVE_SHARED = false' >>Config
54endif
d00f43f9 55 echo 'KERNEL_SOURCE = /usr/src/kernel-headers-2.4.5' >>Config
4d5c35c0
DS
56
57 $(MAKE)
58
59 touch build-stamp
60
d00f43f9 61clean: debian/control
4d5c35c0
DS
62 dh_testdir
63 dh_testroot
64 rm -f build-stamp
65
f0446fcb
DS
66 rm -f debian/$(p_dev)
67
4d5c35c0
DS
68 # Add here commands to clean up after the build process.
69 -$(MAKE) clean
70
71 dh_clean
72
93c8ab68 73install: build debian/control
4d5c35c0
DS
74 dh_testdir
75 dh_testroot
76 dh_clean -k
77 dh_installdirs
78
93c8ab68
DS
79 -rm debian/$(p_dev)
80 ln -s tmp debian/$(p_dev)
81
4d5c35c0 82 # Add here commands to install the package into debian/tmp.
f0446fcb
DS
83 $(MAKE) install_dev PREFIX=`pwd`/debian/$(p_dev)
84 $(MAKE) install_runtime PREFIX=`pwd`/debian/$(p_lib)
85 $(MAKE) install_gcc PREFIX=`pwd`/debian/$(p_gcc)
4d5c35c0 86
93c8ab68 87 install -d debian/$(p_gcc)/usr/share/man/man1
4d5c35c0 88 install -m 644 debian/uclibc-gcc.1 \
93c8ab68
DS
89 debian/$(p_gcc)/usr/share/man/man1/$(target)-uclibc-gcc.1
90 (cd debian/$(p_gcc)/usr/share/man/man1; \
4d5c35c0
DS
91 ln -sf $(target)-uclibc-gcc.1.gz $(target)-uclibc-cc.1.gz; \
92 ln -sf $(target)-uclibc-gcc.1.gz $(target)-uclibc-ld.1.gz; \
93 for x in addr2line ar as cpp gasp nm objcopy objdump ranlib \
94 size strings strip;do \
95 ln -sf $$x.1.gz $(target)-uclibc-$$x.1.gz;done)
96
93c8ab68 97 install -d debian/$(p_lib)/usr/share/man/man1
4d5c35c0 98 install -m 644 debian/uclibc-ldd.1 \
93c8ab68 99 debian/$(p_lib)/usr/share/man/man1/$(target)-uclibc-ldd.1
4d5c35c0 100 install -m 644 debian/uclibc-ldconfig.1 \
93c8ab68 101 debian/$(p_lib)/usr/share/man/man1/$(target)-uclibc-ldconfig.1
4d5c35c0 102
ca240d0e 103ifeq ($(with_shared_libs),y)
93c8ab68
DS
104ifeq ($(target),$(DEB_HOST_GNU_CPU))
105 mkdir -p debian/$(p_lib)/lib/
413643c6 106 ln -sf /usr/$(target)-linux-uclibc/lib/ld-uClibc.so.0 \
93c8ab68
DS
107 debian/$(p_lib)/lib/ld-uClibc.so.0
108endif
ca240d0e 109endif
bca0309a 110
4d5c35c0 111# Build architecture-independent files here.
93c8ab68 112binary-indep:
4d5c35c0
DS
113
114# Build architecture-dependent files here.
115binary-arch: build install
116# dh_testversion
117 dh_testdir
118 dh_testroot
119
120# dh_installdebconf
121 dh_installdocs
122 dh_installexamples
123 dh_installmenu
124# dh_installemacsen
125# dh_installpam
126# dh_installinit
127 dh_installcron
128# dh_installmanpages -plibuclibc0
129 dh_installinfo
130# dh_undocumented
131 dh_installchangelogs
132 dh_link
133 dh_strip
134 dh_compress
e3424a39 135 dh_fixperms -Xld-uClibc
4d5c35c0
DS
136 # You may want to make some executables suid here.
137# dh_suidregister
138# dh_makeshlibs
139 dh_installdeb
140# dh_perl
93c8ab68
DS
141ifeq ($(target),$(DEB_HOST_GNU_CPU))
142 dh_shlibdeps --exclude=ld_uclibc -ldebian/$(p_lib)/usr/$(target)-linux-uclibc/lib
143else
144 dh_shlibdeps --exclude=lib
145endif
4d5c35c0
DS
146 dh_gencontrol
147 dh_md5sums
148 dh_builddeb
149
150binary: binary-indep binary-arch
151.PHONY: build clean binary-indep binary-arch binary install
This page took 0.043337 seconds and 4 git commands to generate.