File: rules

package info (click to toggle)
sofa-framework 1.0~beta4-4
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 88,224 kB
  • ctags: 26,759
  • sloc: cpp: 151,113; ansic: 2,387; xml: 581; sh: 431; makefile: 101
file content (190 lines) | stat: -rwxr-xr-x 5,647 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
#!/usr/bin/make -f

PACKAGE=sofa-framework
DEB_SOURCE_PACKAGE:=$(PACKAGE)

# quilt
include /usr/share/quilt/quilt.make 

# Uncomment this to turn on verbose mode.
export DH_VERBOSE=1


get-orig-source:
	. debian/get-orig-source

configure: configure-stamp
configure-stamp: $(QUILT_STAMPFN)
	dh_testdir
	# Add here commands to configure the package.
	qmake
	(cd applications/projects/runSofa; qmake -o Makefile runSofa.pro)

	# create a folder without object files
	cp -r $(CURDIR)/applications/tutorials $(CURDIR)/tutorials

	touch $@


build: build-arch

build-indep: build-indep-stamp
build-indep-stamp: configure
	dh_testdir

	# Create the documentation files
	mkdir -p $(CURDIR)/doc/doxygen
#	doxygen -u Doxyfile
#	doxygen

	# remove zero byte files
	find $(CURDIR)/doc/doxygen/ -depth -empty | xargs rm -rf

	touch $@


build-arch: build-arch-stamp
build-arch-stamp: configure
	dh_testdir

        # Add here commands to compile the package.
	$(MAKE)

	touch $@


clean: clean-patched unpatch

clean-patched:
	dh_testdir
	dh_testroot
	rm -f build-stamp configure-stamp docs-stamp
	rm -rf bin lib tutorials doc OBJ
	- rm -rf extlibs/tinyxml/
	
	# Add here commands to clean up after the build process.
	#$(MAKE) clean

	dh_clean 


install: install-indep install-arch

install-indep: build-indep
	dh_testdir

	mkdir -p $(CURDIR)/debian/tmp/usr/share/doc/sofa-doc

        # because of a lintian warning
	find tutorials -name "*.kdevelop" | xargs chmod 644

        # install the source code of the example applications
	dh_install -psofa-tutorials    tutorials     usr/share/sofa

	find share -type f -exec chmod 644 \{\} \;
	find share -name "*.sh" | xargs chmod 755

	find examples -type f -exec chmod 644 \{\} \;
	find examples -name "*.sh" | xargs chmod 755

	dh_install -psofa-data   share                                usr/share/sofa
	dh_install -psofa-data   examples                             usr/share/sofa

        # Documentation
#	dh_install -psofa-doc     doc/doxygen/html                    usr/share/doc/sofa-doc
	dh_install -psofa-doc     debian/index.html                   usr/share/doc/sofa-doc/html


	dh_installexamples


install-arch: build-arch
	dh_testdir
	dh_testroot
	dh_installdirs

	dh_install -psofa-apps   debian/sofa.desktop                      usr/share/applications
	dh_install -psofa-apps   debian/sofa.xpm                          usr/share/pixmaps

	# Add here commands to install the package into debian/tmp
#	$(MAKE) install
#	$(MAKE) INSTALL_DIR=$(CURDIR)/debian/tmp install


	mkdir -p $(CURDIR)/debian/tmp/usr/bin
	mkdir -p $(CURDIR)/debian/tmp/usr/lib
	mkdir -p $(CURDIR)/debian/tmp/usr/include
	mkdir -p $(CURDIR)/debian/tmp/usr/lib/sofa-framework

	find framework -name "*.h" | xargs -i cp --parents {} $(CURDIR)/debian/tmp/usr/include/
	find framework -name "*.inl" | xargs -i cp --parents {} $(CURDIR)/debian/tmp/usr/include/
	cp -rf $(CURDIR)/debian/tmp/usr/include/framework/* $(CURDIR)/debian/tmp/usr/include/
	rm -rf $(CURDIR)/debian/tmp/usr/include/framework

	find modules -name "*.h" | xargs -i cp --parents {} $(CURDIR)/debian/tmp/usr/include/
	find modules -name "*.inl" | xargs -i cp --parents {} $(CURDIR)/debian/tmp/usr/include/
	cp -rf $(CURDIR)/debian/tmp/usr/include/modules/* $(CURDIR)/debian/tmp/usr/include/
	rm -rf $(CURDIR)/debian/tmp/usr/include/modules

	find applications -name "*.h" | xargs -i cp --parents {} $(CURDIR)/debian/tmp/usr/include/
	find applications -name "*.inl" | xargs -i cp --parents {} $(CURDIR)/debian/tmp/usr/include/
	cp -rf $(CURDIR)/debian/tmp/usr/include/applications/* $(CURDIR)/debian/tmp/usr/include/
	rm -rf $(CURDIR)/debian/tmp/usr/include/applications

	mv $(CURDIR)/bin/runSofa         $(CURDIR)/debian/tmp/usr/lib/sofa-framework/sofa
###	mv $(CURDIR)/bin/oneParticule    $(CURDIR)/debian/tmp/usr/bin/sofa_particule
###	mv $(CURDIR)/bin/oneTetrahedron  $(CURDIR)/debian/tmp/usr/bin/sofa_tetrahedron
###	mv $(CURDIR)/bin/chainHybrid     $(CURDIR)/debian/tmp/usr/bin/sofa_chain_hybrid
###	mv $(CURDIR)/bin/mixedPendulum   $(CURDIR)/debian/tmp/usr/bin/sofa_mixed_pendulum


	cp -r $(CURDIR)/lib/linux/lib* $(CURDIR)/debian/tmp/usr/lib/


	dh_install -plibsofa1        debian/tmp/usr/lib/lib*.so.*             usr/lib

	dh_install -plibsofa1-dev    debian/tmp/usr/lib/lib*.so               usr/lib
	dh_install -plibsofa1-dev    debian/tmp/usr/include/*                 usr/include

	dh_install -psofa-apps   debian/tmp/usr/lib/sofa-framework/sofa   usr/lib/sofa-framework
###	dh_install -psofa-apps   debian/tmp/usr/bin/sofa_particule        usr/bin
###	dh_install -psofa-apps   debian/tmp/usr/bin/sofa_tetrahedron      usr/bin
###	dh_install -psofa-apps   debian/tmp/usr/bin/sofa_chain_hybrid     usr/bin
###	dh_install -psofa-apps   debian/tmp/usr/bin/sofa_mixed_pendulum   usr/bin
	dh_install -psofa-apps   debian/sofa                              usr/bin

	dh_installman -psofa-apps debian/sofa.1

# called by binary-indep and binary-arch
binary-common:
	dh_testdir
	dh_testroot
	dh_install
	dh_installchangelogs 
	dh_installdocs
	dh_installmenu
	dh_lintian
	dh_link
	dh_strip
	dh_compress
	dh_fixperms
	dh_makeshlibs
	dh_installdeb
	dh_shlibdeps
	dh_gencontrol
	dh_md5sums
	dh_builddeb


# Build architecture independant packages using the common target.
binary-indep: build-indep install-indep
	$(MAKE) -f debian/rules DH_OPTIONS=-i binary-common


# Build architecture dependant packages using the common target.
binary-arch: build-arch install-arch
	$(MAKE) -f debian/rules DH_OPTIONS=-s binary-common


binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install install-indep install-arch configure