1 # Generic makefile for mBuild build process
3 # defile default operations
5 NOP = @echo "No operation for target $@"
7 COMPILE_TARGET = compile.stamp
9 ZIP = zip -r $(project).zip $(project)
10 DEB = fakeroot dpkg-deb --build $(project)
11 INSERT_BUILD = projects/tools/make/insert_build.sh
18 # Load project specification
21 .SUFFIXES: .stamp .zip
24 #-----------------------------------------------------------------
27 # : ohne Parameter wird compiliert
28 # - zip : packt ZIP file
29 # - deb : packt Debian package
31 #-----------------------------------------------------------------
33 compile: $(COMPILE_TARGET)
40 # Debian package ready
42 version: $(COMPILE_TARGET)
43 $(INSERT_BUILD) $(COMPILE_TARGET) $(build)
45 #-----------------------------------------------------------------
47 #-----------------------------------------------------------------
48 compile.stamp: $(SOURCES)
52 #-----------------------------------------------------------------
54 #-----------------------------------------------------------------
56 copy.stamp: $(COPY_PRE)
57 $(COPY) $(project) $(version) ${arch}
60 control.stamp: $(project).control
61 mkdir -p $(project)/DEBIAN
62 cp $(project).control $(project)/DEBIAN/control
63 if [ -f $(project).preinst ]; then cp $(project).preinst $(project)/DEBIAN/preinst; fi
64 if [ -f $(project).postinst ]; then cp $(project).postinst $(project)/DEBIAN/postinst; fi
65 if [ -f $(project).prerm ]; then cp $(project).prerm $(project)/DEBIAN/prerm; fi
66 if [ -f $(project).postrm ]; then cp $(project).postrm $(project)/DEBIAN/postrm; fi
69 $(project).zip: copy.stamp $(project)
72 $(project).deb: copy.stamp control.stamp
74 cp $(project).deb $(project)_$(version)$(_arch).deb
76 #-----------------------------------------------------------------
78 #-----------------------------------------------------------------
80 -rm *.stamp 2>/dev/null
81 if [ -e $(project).zip ]; then rm $(project).zip; fi
82 if [ -e $(project) ]; then rm -rf $(project); fi
84 #-----------------------------------------------------------------
86 #-----------------------------------------------------------------
87 %.pdf : %.tex $(SOURCES)
88 pdflatex $< && pdflatex $<