2 # Sample debian/rules that uses debhelper.
3 # GNU copyright 1997 to 1999 by Joey Hess.
5 # Uncomment this to turn on verbose mode.
8 # This is the debhelper compatability version to use.
12 major=$(shell grep '^MAJOR_VERSION' Rules.mak|sed 's/.*=//')
13 minor=$(shell grep '^MINOR_VERSION' Rules.mak|sed 's/.*=//')
14 version:=$(strip $(major)).$(strip $(minor))
16 target=$(DEB_HOST_GNU_CPU)
20 #ifeq ($(target),powerpc)
24 ifneq ($(target),$(DEB_HOST_GNU_CPU))
25 target_suffix=-$(target)
28 p_dev=libuclibc-dev$(target_suffix)
29 p_lib=libuclibc0$(target_suffix)
30 p_gcc=uclibc$(target_suffix)-gcc
32 debian/control: debian/control.in
33 sed s/_TARGET_/$(target_suffix)/ debian/control.in >debian/control
39 # Add here commands to compile the package.
40 cp extra/Configs/Config.$(target) Config
42 echo '#Debian configuration overrides' >>Config
43 ifneq ($(target),$(DEB_HOST_GNU_CPU))
44 echo 'TARGET_ARCH = $(target)' >>Config
45 echo 'CROSS = $(target)-linux-' >>Config
47 echo 'DOPIC = true' >>Config
48 echo 'PREFIX = $$(DESTDIR)/usr' >>Config
49 echo 'DEVEL_PREFIX = $$(PREFIX)/$$(TARGET_ARCH)-linux-uclibc' >>Config
50 echo 'TARGET_PREFIX = $$(DESTDIR)/' >>Config
51 ifeq ($(with_shared_libs),n)
52 echo 'HAVE_SHARED = false' >>Config
64 # Add here commands to clean up after the build process.
69 install: build debian/control
76 ln -s tmp debian/$(p_dev)
78 # Add here commands to install the package into debian/tmp.
79 $(MAKE) install_dev DESTDIR=`pwd`/debian/$(p_dev)
80 $(MAKE) install_runtime DESTDIR=`pwd`/debian/$(p_lib)
81 $(MAKE) install_gcc DESTDIR=`pwd`/debian/$(p_gcc)
83 install -d debian/$(p_gcc)/usr/share/man/man1
84 install -m 644 debian/uclibc-gcc.1 \
85 debian/$(p_gcc)/usr/share/man/man1/$(target)-uclibc-gcc.1
86 (cd debian/$(p_gcc)/usr/share/man/man1; \
87 ln -sf $(target)-uclibc-gcc.1.gz $(target)-uclibc-cc.1.gz; \
88 ln -sf $(target)-uclibc-gcc.1.gz $(target)-uclibc-ld.1.gz; \
89 for x in addr2line ar as cpp gasp nm objcopy objdump ranlib \
90 size strings strip;do \
91 ln -sf $$x.1.gz $(target)-uclibc-$$x.1.gz;done)
93 install -d debian/$(p_lib)/usr/share/man/man1
94 install -m 644 debian/uclibc-ldd.1 \
95 debian/$(p_lib)/usr/share/man/man1/$(target)-uclibc-ldd.1
96 install -m 644 debian/uclibc-ldconfig.1 \
97 debian/$(p_lib)/usr/share/man/man1/$(target)-uclibc-ldconfig.1
99 ifeq ($(with_shared_libs),y)
100 ifeq ($(target),$(DEB_HOST_GNU_CPU))
101 mkdir -p debian/$(p_lib)/lib/
102 ln -sf /usr/$(target)-uclibc-linux/lib/ld-uClibc.so.0 \
103 debian/$(p_lib)/lib/ld-uClibc.so.0
107 # Build architecture-independent files here.
110 # Build architecture-dependent files here.
111 binary-arch: build install
124 # dh_installmanpages -plibuclibc0
131 dh_fixperms -Xld-uClibc
132 # You may want to make some executables suid here.
137 ifeq ($(target),$(DEB_HOST_GNU_CPU))
138 dh_shlibdeps --exclude=ld_uclibc -ldebian/$(p_lib)/usr/$(target)-linux-uclibc/lib
140 dh_shlibdeps --exclude=lib
146 binary: binary-indep binary-arch
147 .PHONY: build clean binary-indep binary-arch binary install