aboutsummaryrefslogtreecommitdiff
path: root/src/Makefile
diff options
context:
space:
mode:
authorIOhannes m zmölnig <zmoelnig@users.sourceforge.net>2006-03-01 12:13:45 +0000
committerIOhannes m zmölnig <zmoelnig@users.sourceforge.net>2006-03-01 12:13:45 +0000
commit45ddc4c6949f98098a1f0dbb14a9e933c82e0855 (patch)
tree98add62b3280873b6accbaf554cc2d6d3c2b4703 /src/Makefile
parent52e1cb58409d4cc50982ed6fa5c8836c01a633a8 (diff)
build-system
svn path=/trunk/externals/iem/iem_bin_ambi/; revision=4636
Diffstat (limited to 'src/Makefile')
-rw-r--r--src/Makefile82
1 files changed, 82 insertions, 0 deletions
diff --git a/src/Makefile b/src/Makefile
new file mode 100644
index 0000000..7cb2ee7
--- /dev/null
+++ b/src/Makefile
@@ -0,0 +1,82 @@
+default: all
+
+.PHONEY: default all everything dist \
+ clean realclean distclean \
+ install install-bin install-doc install-abs
+
+SOURCES=$(sort $(filter %.c, $(wildcard *.c)))
+
+Make.config: Make.config.in configure
+ ./configure
+
+configure: configure.ac
+ autoconf
+
+## uaehh, here comes some magic
+## 1st we don't want depend and config-makefiles to be included on "clean"-targets
+
+ifeq (,$(findstring clean, $(MAKECMDGOALS)))
+-include $(SOURCES:.c=.d)
+-include Make.config
+endif
+
+## 2nd only generate depend-files when we have Make.config included
+## and thus MAKEDEP_FLAGS defined
+ifdef MAKEDEP_FLAGS
+## dependencies: as proposed by the GNU-make documentation
+## see http://www.gnu.org/software/make/manual/html_node/make_47.html#SEC51
+%.d: %.c
+ @set -e; rm -f $@; \
+ $(CPP) $(MAKEDEP_FLAGS) $(Z_CFLAGS) $< > $@.$$$$; \
+ sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' < $@.$$$$ > $@; \
+ rm -f $@.$$$$
+endif
+
+.SUFFIXES: .$(EXT)
+
+TARGETS = $(SOURCES:.c=.o)
+
+
+all: $(LIBNAME)
+ cp $(LIBNAME).$(EXT) ..
+
+$(LIBNAME): $(TARGETS)
+ $(LD) $(LFLAGS) -o $(LIBNAME).$(EXT) *.o $(LIBS)
+ $(STRIP) $(STRIPFLAGS) $(LIBNAME).$(EXT)
+
+$(TARGETS): %.o : %.c
+ $(CC) $(Z_CFLAGS) -c -o $@ $*.c
+
+
+clean:
+ -rm -f *.$(EXT) *.o
+
+realclean: clean
+ -rm -f *~ _* config.*
+ -rm -f *.d *.d.*
+
+distclean: realclean
+ -rm -f Make.config ../*.$(EXT)
+ -rm -f *.exp *.lib *.ncb \
+ *.opt *.plg
+ -rm -rf autom4te.cache/
+
+install: install-bin install-doc install-abs
+
+install-bin:
+ -install -d $(INSTALL_BIN)
+ -install -m 644 $(LIBNAME).$(EXT) $(INSTALL_BIN)
+
+install-doc:
+ -install -d $(INSTALL_DOC)
+ -install -m 644 ../examples/*.pd $(INSTALL_DOC)
+
+install-abs:
+ -install -d $(INSTALL_BIN)
+ -install -m 644 ../abs/*.pd $(INSTALL_BIN)
+
+dist: all realclean
+ (cd ../..;tar czvf $(TARNAME) $(LIBNAME))
+
+everything: clean all install distclean
+