X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/projects.git/blobdiff_plain/e8baabd499d9d4ef551f89102424930c3185a4b3..6d98500b790e3808cf2fbda4a393717b40b0bbd1:/tools/make/makefile diff --git a/tools/make/makefile b/tools/make/makefile index 57dc39d..9ade437 100644 --- a/tools/make/makefile +++ b/tools/make/makefile @@ -1,85 +1,34 @@ # Generic makefile for mBuild build process -# defile default operations - -NOP = @echo "No operation for target $@" -COMPILE = $(NOP) -COMPILE_TARGET = compile.stamp -COPY = $(NOP) -ZIP = zip -r $(project).zip $(project) -DEB = fakeroot dpkg-deb --build $(project) -INSERT_BUILD = projects/tools/make/insert_build.sh -#default parameters -project = default -SOURCES = -COPY_PRE = +# 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 -# -#----------------------------------------------------------------- - -compile: $(COMPILE_TARGET) - # compile ist fertig - -zip: $(project).zip - # ZIP file ready - -deb: $(project).deb - # Debian package ready - -version: $(COMPILE_TARGET) - $(INSERT_BUILD) $(COMPILE_TARGET) $(build) +# All Target +all: $(DEPS) $(SOURCE:%.cpp=%.o) $(TARGET) -#----------------------------------------------------------------- -# compile steps -#----------------------------------------------------------------- -compile.stamp: $(SOURCES) - $(COMPILE) - @touch compile.stamp +# Other Targets +clean: + -rm *.o + -rm $(TARGET) -#----------------------------------------------------------------- -# pack steps -#----------------------------------------------------------------- -copy.stamp: $(COPY_PRE) - $(COPY) $(project) $(version) ${arch} - @touch copy.stamp +.PHONY: all make.post -control.stamp: $(project).control - mkdir -p $(project)/DEBIAN - cp $(project).control $(project)/DEBIAN/control - if [ -f $(project).preinst ]; then cp $(project).preinst $(project)/DEBIAN/preinst; fi - if [ -f $(project).postinst ]; then cp $(project).postinst $(project)/DEBIAN/postinst; fi - if [ -f $(project).prerm ]; then cp $(project).prerm $(project)/DEBIAN/prerm; fi - if [ -f $(project).postrm ]; then cp $(project).postrm $(project)/DEBIAN/postrm; fi - @touch control.stamp +%.a: $(SOURCE:%.cpp=%.o) + ar r $(TARGET) *.o -$(project).zip: copy.stamp $(project) - $(ZIP) +%.so: $(SOURCE:%.cpp=%.o) $(LDLIBS) + $(CXX) -shared -o $(TARGET) *.o $(LDLIBS) $(EXTLIB) -$(project).deb: copy.stamp control.stamp - $(DEB) - cp $(project).deb $(project)_$(version)$(_arch).deb +make.pre: ~/build/debian/rules.pre + cp ~/build/debian/rules.pre make.pre -#----------------------------------------------------------------- -# 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 #----------------------------------------------------------------- # Build-Regeln