OpenCores
URL https://opencores.org/ocsvn/or1k_old/or1k_old/trunk

Subversion Repositories or1k_old

[/] [or1k_old/] [trunk/] [linux/] [uClibc/] [debian/] [rules] - Blame information for rev 1325

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1325 phoenix
#!/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.
9
export DH_COMPAT=3
10
 
11
#include version
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))
15
 
16
kernel_version=2.4.22
17
kernel_source=kernel-source-$(kernel_version)
18
 
19
builddir=$(shell pwd)
20
 
21
target=$(DEB_HOST_GNU_CPU)
22
 
23
with_shared_libs=y
24
 
25
ifeq ($(with_shared_libs),y)
26
shared_libs_true=true
27
else
28
shared_libs_true=false
29
endif
30
 
31
ifneq ($(target),$(DEB_HOST_GNU_CPU))
32
target_suffix=-$(target)
33
endif
34
 
35
ifneq ($(target),$(DEB_HOST_GNU_CPU))
36
cross_options = --cross="$(target)-linux-"
37
else
38
cross_options = --cross=""
39
endif
40
 
41
p_dev=uclibc-dev$(target_suffix)
42
p_lib=uclibc$(target_suffix)
43
 
44
build: build-stamp
45
build-stamp:
46
        dh_testdir
47
 
48
        # Brute force method of getting kernel headers
49
        tar --bzip2 -xf /usr/src/$(kernel_source).tar.bz2 \
50
          $(kernel_source)/Makefile $(kernel_source)/include
51
 
52
 
53
        # Hack to get include/asm-arm/arch directory.  This should
54
        # stay here, and not move to the top-level Makefile, since
55
        # it adds a link _in the kernel source_, which is almost
56
        # certainly wrong in most situations.
57
#ifeq ($(target),arm)
58
        ln -s arch-sa1100 $(kernel_source)/include/asm-arm/arch
59
        ln -s proc-armo $(kernel_source)/include/asm-arm/proc
60
#endif
61
 
62
        touch $(kernel_source)/include/linux/autoconf.h
63
 
64
        # Various stupid programs use linux/version.h to find the
65
        # Linux version.
66
        ( \
67
                echo '#define UTS_RELEASE "$(kernel_version)"'; \
68
                echo '#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))'; \
69
                echo '#define LINUX_VERSION_CODE KERNEL_VERSION($(shell echo $(kernel_version) | sed s/\\./,/g))'; \
70
        ) >$(kernel_source)/include/linux/version.h
71
 
72
        cp debian/config .config
73
 
74
        sed -i -e 's,^.*TARGET_$(target).*,TARGET_$(target)=y,g' \
75
                .config
76
        sed -i -e 's,^TARGET_ARCH.*,TARGET_ARCH=\"$(target)\",g' \
77
                .config
78
        sed -i -e 's,^KERNEL_SOURCE=.*,KERNEL_SOURCE=\"$(builddir)/$(kernel_source)\",g' \
79
                .config
80
        sed -i -e 's,^RUNTIME_PREFIX=.*,RUNTIME_PREFIX=\"/\",g' \
81
                .config
82
        sed -i -e 's,^DEVEL_PREFIX=.*,DEVEL_PREFIX=\"/usr/\",g' \
83
                .config
84
        sed -i -e 's,^SHARED_LIB_LOADER_PREFIX=.*,SHARED_LIB_LOADER_PREFIX=\"/lib\",g' \
85
                .config
86
        sed -i -e 's,.*UCLIBC_HAS_WCHAR.*,UCLIBC_HAS_WCHAR=y\nUCLIBC_HAS_LOCALE=n,g' \
87
                .config
88
 
89
ifeq ($(target),arm)
90
                sed -i -e 's,.*HAS_FPU.*,HAS_FPU=n\nUCLIBC_HAS_FLOATS=y\nUCLIBC_HAS_SOFT_FLOAT=y,g' .config
91
        echo CONFIG_GENERIC_ARM=y >>.config
92
endif
93
ifeq ($(target),i386)
94
        echo CONFIG_GENERIC_386=y >>.config
95
endif
96
        yes '' | make oldconfig
97
 
98
        mkdir -p lib
99
 
100
        $(MAKE)
101
        $(MAKE) utils
102
 
103
        touch build-stamp
104
 
105
clean:
106
        dh_testdir
107
        dh_testroot
108
        rm -f build-stamp
109
 
110
        rm -rf kernel-source-*
111
 
112
        # Add here commands to clean up after the build process.
113
        -$(MAKE) distclean
114
 
115
        -rm -f Config
116
 
117
        dh_clean
118
 
119
install: build
120
        dh_testdir
121
        dh_testroot
122
        dh_clean -k
123
        dh_installdirs
124
 
125
        -rm debian/tmp
126
        -mkdir debian/tmp
127
 
128
        # Add here commands to install the package into debian/tmp.
129
        $(MAKE) install install_utils PREFIX=`pwd`/debian/tmp
130
 
131
        install -d debian/tmp/usr/share/man/man1
132
        install -m 644 debian/ldd.1 \
133
          debian/tmp/usr/share/man/man1/ldd.1
134
        install -m 644 debian/ldconfig.1 \
135
          debian/tmp/usr/share/man/man1/ldconfig.1
136
 
137
 
138
# Build architecture-independent files here.
139
binary-indep:
140
 
141
# Build architecture-dependent files here.
142
binary-arch: build install
143
#       dh_testversion
144
        dh_testdir
145
        dh_testroot
146
 
147
        dh_movefiles
148
#       dh_installdebconf
149
        dh_installdocs
150
        dh_installexamples
151
        dh_installmenu
152
#       dh_installemacsen
153
#       dh_installpam
154
#       dh_installinit
155
        dh_installcron
156
#       dh_installmanpages -puclibc
157
        dh_installinfo
158
#       dh_undocumented
159
        dh_installchangelogs
160
        dh_link
161
        dh_strip
162
        dh_compress
163
        dh_fixperms -Xld-uClibc
164
        # You may want to make some executables suid here.
165
#       dh_suidregister
166
#       dh_makeshlibs
167
        dh_installdeb
168
#       dh_perl
169
        dh_shlibdeps --exclude=lib
170
        dh_gencontrol
171
        dh_md5sums
172
        dh_builddeb
173
 
174
binary: binary-indep binary-arch
175
.PHONY: build clean binary-indep binary-arch binary install

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.