From 1d06320825d2a9e214cc324c2b2e833aba3edf4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Thu, 15 Mar 2007 16:49:24 +0000 Subject: added the snmp-external (this has been lying on my harddisk for ages) svn path=/trunk/externals/iem/snmp/; revision=7492 --- Makefile | 84 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 Makefile (limited to 'Makefile') diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..96f86a2 --- /dev/null +++ b/Makefile @@ -0,0 +1,84 @@ +default: all + +.PHONEY: default all everything dist \ + clean realclean distclean \ + install install-bin install-doc install-abs \ + tests + +HELPERSOURCES= +OBJECTSOURCES=$(sort $(filter-out $(HELPERSOURCES), $(filter %.c, $(wildcard *.c)))) +SOURCES=$(OBJECTSOURCES) $(HELPERSOURCES) + + +configure: configure.ac + autoconf + +-include $(SOURCES:.c=.d) + +Make.config: Make.config.in configure + ./configure $(CONFIGUREFLAGS) + +-include Make.config + + +## 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) + +OBJECTS = $(OBJECTSOURCES:.c=.$(EXT)) + + +## if $(BUILDLIBRARY) is defined, we build everything as a single library +## else we build separate externals +ifneq "$(BUILDLIBRARY)" "" +all: $(LIBNAME) + cp $(LIBNAME).$(EXT) .. +else +all: $(OBJECTS) +endif + +$(OBJECTS): %.$(EXT) : %.o + $(LD) $(LFLAGS) -o $@ $*.o $(LIBS) + $(STRIP) $(STRIPFLAGS) $@ + + +$(LIBNAME): $(TARGETS) + $(LD) $(LFLAGS) -o $@.$(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-bin: + -install -d $(INSTALL_BIN) + -install -m 644 $(LIBNAME).$(EXT) $(INSTALL_BIN) + +install-doc: + +everything: clean all install distclean -- cgit v1.2.1