--- Makefile 2007-07-10 15:02:50.000000000 +0200 +++ Makefile.oden 2007-07-10 19:03:46.000000000 +0200 @@ -1,85 +1,60 @@ -# -# VERSION CHANGES -# -# 0.1.13: Added -I. - -LOCATION=/usr/local -VERSION=0.1.14 -# VERSION changes -#--------------------- -# 0.1.14: Added 'install' usage -# -#CC=gcc - -# if there isn't already a default CFLAGS set, -# use our recommended settings. -#CFLAGS ?= -Wall -g -O2 -Werror $(CPU_OPTS) -#CFLAGS=-Wall -g -O2 -Wundef -Wshadow -Wsign-compare -I. -CFLAGS=-Wall -g -I. - -# OLE decoding is still considered to be 'beta' mode - so it -# disabled in the stable release of ripMIME for now -# You can turn it on, but watch out for various office files -# which may/probably-will break ripMIME with a segfault -# or other strange errors. If you do wish to test this -# and find a dud mailpack, please send through to -# mailpacks@pldaniels.com -# -COMPONENTS= -DRIPOLE -LIBS= -#COMPONENTS= - -# DEBUGGING Related Flags - -OBJ=ripmime -RIPOLE_OBJS= ripOLE/ole.o ripOLE/olestream-unwrap.o ripOLE/bytedecoders.o ripOLE/bt-int.o -#RIPOLE_OBJS= -OFILES= strstack.o mime.o ffget.o MIME_headers.o tnef/tnef.o rawget.o pldstr.o logger.o libmime-decoders.o boundary-stack.o uuencode.o filename-filters.o $(RIPOLE_OBJS) +CFLAGS+=-Wall -I. -fPIC -DPIC -D_REENTRANT +CFLAGS+=-Itnef -D___TNEF_BYTE_ORDER=4321 +CC=gcc +bindir = /usr/bin +libdir = /usr/lib +includedir = /usr/include +mandir = /usr/share/man +DESTDIR = + +AR = ar +RANLIB = ranlib +LIBTOOL = libtool +INSTALL = install -c +LDFLAGS = +LIBS=-lripole + +LT_CURRENT=5 +LT_REVISION=0 +LT_AGE=4 + +OBJS= strstack.o mime.o ffget.o MIME_headers.o tnef/tnef.o \ + rawget.o pldstr.o logger.o libmime-decoders.o boundary-stack.o \ + uuencode.o filename-filters.o +LTOBJS:= $(OBJS:.o=.lo) -default: tnef/tnef.o ripmime ripOLE/ole.o +all: buildcodes.h libripmime.la ripmime -buildcodes.h: +buildcodes.h: ./generate-buildcodes.sh -ripOLE/ole.o: - ./build_ripOLE - -tnef/tnef.o: - ./build_tnef - -.c.o: - ${CC} ${CFLAGS} $(COMPONENTS) -c $*.c - -all: ${OBJ} - - -solib: ${OFILES} ripmime-api.o - gcc --shared -Wl,-soname,libripmime.so.1 ${OFILES} ripmime-api.o -o libripmime.so.1.4.0 -lc - -libripmime: ${OFILES} ripmime-api.o - ar ruvs libripmime.a ${OFILES} ripmime-api.o - -ripl: ripmime.a - ${CC} ${CFLAGS} ripmime.c ripmime.a -o ripmime - -sco: ${OFILES} - ${CC} ${CFLAGS} ripmime.c ${OFILES} -o ripmime -lsocket - -ripmime: ${OFILES} ripmime.c buildcodes.h - ${CC} ${CFLAGS} $(COMPONENTS) ripmime.c ${OFILES} -o ripmime ${LIBS} - -riptest: ${OFILES} - ${CC} ${CFLAGS} riptest.c ${OFILES} -o riptest - -install: ${OBJ} - strip ripmime - cp ripmime ${LOCATION}/bin/ - cp ripmime.1 ${LOCATION}/man/man1 +libripmime.la: $(LTOBJS) ripmime-api.o + $(LIBTOOL) --mode=link $(CC) $(CFLAGS) $(LDFLAGS) -rpath $(libdir) \ + -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) -o \ + libripmime.la $(LTOBJS) $(LIBS) + +ripmime: ripmime.o libripmime.la + $(LIBTOOL) --mode=link $(CC) $(CFLAGS) -o $@ $(LDFLAGS) $(LIBS) $^ + +%.o: %.c + $(CC) -c $(CFLAGS) $< -o $@ + +%.lo: %.c + $(LIBTOOL) --mode=compile $(CC) -c $(CFLAGS) $< -o $@ + +install: + $(INSTALL) -d $(DESTDIR)$(bindir) + $(INSTALL) -d $(DESTDIR)$(libdir) + $(INSTALL) -d $(DESTDIR)$(includedir)/ripmime + $(INSTALL) -d $(DESTDIR)$(mandir)/man1 + $(LIBTOOL) --mode=install $(INSTALL) libripmime.la $(DESTDIR)$(libdir) + $(LIBTOOL) --mode=install $(INSTALL) -m 755 ripmime $(DESTDIR)$(bindir) + $(INSTALL) -m 644 *.h $(DESTDIR)$(includedir)/ripmime + $(INSTALL) -m 644 ripmime.1 $(DESTDIR)$(mandir)/man1 clean: - rm -f *.o *core ${OBJ} buildcodes.h - rm -f tnef/*.o - rm -f ripOLE/*.o ripOLE/ripole + rm -f *.o *core buildcodes.h *.lo *.a *.la ripmime + rm -rf .libs + rm -f tnef/*.o tnef/*.lo tnef/*.a tnef/*.la + rm -rf tnef/.libs -MIMEH: MIME_headers.o strlower.o - ${CC} ${CFLAGS} MIMEH_test.c MIME_headers.o strlower.o -o MIMEH_test