$OpenBSD: patch-Makefile_in,v 1.2 2005/12/26 18:02:44 steven Exp $ --- Makefile.in.orig Thu Nov 26 17:03:29 1998 +++ Makefile.in Mon Dec 26 18:59:52 2005 @@ -15,11 +15,13 @@ CFLAGS = $(OPTIMIZE) $(EXTRA_CFLA CPPFLAGS = $(INCLUDE_DIRS) $(DEFINES) # Installation directories (and install program) +DESTDIR = + prefix = @prefix@ exec_prefix = @exec_prefix@ INSTALL_INCLUDE = @includedir@ INSTALL_LIBRARY = @libdir@ -INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ # Other miscellaneous programs AR = @AR@ @@ -37,6 +39,7 @@ DITHER_SRC = fs2.c fs2fast.c fs4.c hy mono.c ordered.c ordered2.c mb_ordered.c LIBSRC = @libsrc@ LIBOBJ = @libobj@ +SHLIBOBJ = $(LIBOBJ:.o=.so) # Other files of interest @@ -46,15 +49,20 @@ SHLIB = libmpeg.so HEADER = mpeg.h EXTRAS = @extras@ +PICFLAG = -fpic + +.SUFFIXES: .o .so + # Implicit targets .c.o: $(CC) -c $(CFLAGS) $(CPPFLAGS) $< +.c.so: + $(CC) -c $(CFLAGS) $(CPPFLAGS) $(PICFLAG) $< -o $@ + # Library/cleanup targets: -all: lib $(EXTRAS) - lib: $(LIBRARY) shlib: $(SHLIB) @@ -63,17 +71,24 @@ $(LIBRARY): $(LIBOBJ) $(AR) $(ARFLAGS) $(LIBRARY) $(LIBOBJ) $(RANLIB) $(LIBRARY) -$(SHLIB): $(LIBOBJ) - $(CC) -shared -o $(SHLIB) $(LIBOBJ) +$(SHLIB): $(SHLIBOBJ) + $(CC) -shared $(PICFLAG) -o $(SHLIB) $(SHLIBOBJ) +.if defined(NO_SHARED_LIBS) && ${NO_SHARED_LIBS:L} == "yes" +all: lib $(EXTRAS) install: $(LIBRARY) - $(INSTALL) -d $(INSTALL_INCLUDE) $(INSTALL_LIBRARY) - $(INSTALL) -m 0644 $(HEADER) $(INSTALL_INCLUDE)/$(HEADER) - $(INSTALL) -m 0644 $(LIBRARY) $(INSTALL_LIBRARY)/$(LIBRARY) - @if test -f $(SHLIB) ; then echo "warning: $(SHLIB) *not* installed (installing shared libraries is too system-specific)" ; fi +.else +all: lib shlib $(EXTRAS) +install: $(LIBRARY) $(SHLIB) +.endif + $(INSTALL_DATA) $(HEADER) $(DESTDIR)$(INSTALL_INCLUDE) + $(INSTALL_DATA) $(LIBRARY) $(DESTDIR)$(INSTALL_LIBRARY) + @if [ -f $(SHLIB) ]; then \ + $(INSTALL_DATA) $(SHLIB) $(DESTDIR)$(INSTALL_LIBRARY); \ + fi clean: - rm -f $(LIBRARY) $(EXTRAS) $(LIBOBJ) core + rm -f $(LIBRARY) $(SHLIB) $(EXTRAS) $(LIBOBJ) $(SHLIBOBJ) core cd extras && $(MAKE) clean distclean: clean