posaune
[projects.git] / tools / make / makefile
index 8b83ff7..9ade437 100644 (file)
@@ -1,76 +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 =
+# 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.stamp
-       # compile ist fertig
-
-zip: $(project).zip
-       # ZIP file ready
+# All Target
+all: $(DEPS) $(SOURCE:%.cpp=%.o) $(TARGET)
 
-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
+-include make.post
+# defile default operations
 
 #-----------------------------------------------------------------
-# utilities
+# Build-Regeln
 #-----------------------------------------------------------------
-clean:
-       -rm *.stamp 2>/dev/null
-       if [ -e $(project).zip ]; then rm $(project).zip; fi
-       if [ -e $(project) ]; then rm -rf $(project); fi
+%.pdf : %.tex $(SOURCES)
+       pdflatex $< && pdflatex $<