X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/projects.git/blobdiff_plain/c9b0630e680308a6389cdf758bb677d811a2d05b..6d98500b790e3808cf2fbda4a393717b40b0bbd1:/tools/make/makefile diff --git a/tools/make/makefile b/tools/make/makefile index 7fadac9..9ade437 100644 --- a/tools/make/makefile +++ b/tools/make/makefile @@ -1,84 +1,38 @@ # Generic makefile for mBuild build process -# defile default operations - -NOP = @echo "No operation for target $@" -COMPILE = $(NOP) -COPY = $(NOP) -ZIP = zip -r $(project).zip $(project) -DEB = fakeroot dpkg-deb --build $(project) -#default parameters -project = default -SOURCES = -COPY_PRE = -TEX = pdflatex +# default parameters +CC = g++ +INSERT_BUILD = /usr/share/mbuild/insert_build.sh -# Load project specification include make.pre -.SUFFIXES: .stamp .zip - - -#----------------------------------------------------------------- -# Hauptziele: -# -# : ohne Parameter wird compiliert -# - zip : packt ZIP file -# - deb : packt Debian package -# -#----------------------------------------------------------------- +# All Target +all: $(DEPS) $(SOURCE:%.cpp=%.o) $(TARGET) -compile: compile.stamp - # compile ist fertig - -zip: $(project).zip - # ZIP file ready - -deb: $(project).deb - # Debian package ready - -#----------------------------------------------------------------- -# compile steps -#----------------------------------------------------------------- +# Other Targets +clean: + -rm *.o + -rm $(TARGET) -compile.stamp: $(SOURCES) - $(COMPILE) - @touch compile.stamp -#----------------------------------------------------------------- -# pack steps -#----------------------------------------------------------------- +.PHONY: all make.post -copy.stamp: $(COPY_PRE) - $(COPY) $(project) - @touch copy.stamp +%.a: $(SOURCE:%.cpp=%.o) + ar r $(TARGET) *.o -control.stamp: $(project).control - mkdir -p $(project)/DEBIAN - cp $(project).control $(project)/DEBIAN/control - if [ -f $(project).postinst ]; then cp $(project).postinst $(project)/DEBIAN/postinst; fi - @touch control.stamp +%.so: $(SOURCE:%.cpp=%.o) $(LDLIBS) + $(CXX) -shared -o $(TARGET) *.o $(LDLIBS) $(EXTLIB) -$(project).zip: copy.stamp $(project) - $(ZIP) +make.pre: ~/build/debian/rules.pre + cp ~/build/debian/rules.pre make.pre -$(project).deb: copy.stamp control.stamp - $(DEB) - cp $(project).deb $(project)_$(version).deb - -#----------------------------------------------------------------- -# utilities -#----------------------------------------------------------------- -clean: - -rm *.stamp 2>/dev/null - if [ -e $(project).zip ]; then rm $(project).zip; fi - if [ -e $(project) ]; then rm -rf $(project); fi +-include make.post +# defile default operations #----------------------------------------------------------------- -# generische Regeln +# Build-Regeln #----------------------------------------------------------------- -%.pdf:%.tex - $(TEX) $< +%.pdf : %.tex $(SOURCES) + pdflatex $< && pdflatex $< --include make.post