Skip to content
Permalink
Browse files

Use gcc's built-in dependency generation, thanks to Adam Strzelecki

  • Loading branch information
slouken committed Oct 4, 2009
1 parent 64ff487 commit d3e429a527243db7b667d6f0d68810642193d211
Showing with 60 additions and 121 deletions.
  1. +22 −21 Makefile.in
  2. +0 −93 build-scripts/makedep.sh
  3. +38 −7 configure.in
@@ -3,14 +3,14 @@
top_builddir = .
srcdir = @srcdir@
objects = build
depend = build-deps
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = $(DESTDIR)@bindir@
libdir = $(DESTDIR)@libdir@
includedir = $(DESTDIR)@includedir@
datadir = $(DESTDIR)@datadir@
mandir = $(DESTDIR)@mandir@
datarootdir = $(DESTDIR)@datarootdir@
datadir = @datadir@
mandir = @mandir@
auxdir = @ac_aux_dir@
distpath = $(srcdir)/..
distdir = SDL_mixer-@VERSION@
@@ -33,8 +33,10 @@ SDL_CFLAGS = @SDL_CFLAGS@
SDL_LIBS = @SDL_LIBS@

TARGET = libSDL_mixer.la
SOURCES = @SOURCES@
OBJECTS = @OBJECTS@
VERSION_OBJECTS = @VERSION_OBJECTS@
PLAYWAVE_OBJECTS = @PLAYWAVE_OBJECTS@
PLAYMUS_OBJECTS = @PLAYMUS_OBJECTS@

DIST = CHANGES COPYING CWProjects.sea.bin MPWmake.sea.bin Makefile.in SDL_mixer.pc.in README SDL_mixer.h SDL_mixer.qpg.in SDL_mixer.spec SDL_mixer.spec.in VisualC.zip Watcom-OS2.zip Xcode.tar.gz acinclude autogen.sh build-scripts configure configure.in dynamic_mp3.c dynamic_mp3.h dynamic_ogg.c dynamic_ogg.h effect_position.c effect_stereoreverse.c effects_internal.c effects_internal.h gcc-fat.sh load_aiff.c load_aiff.h load_ogg.c load_ogg.h load_voc.c load_voc.h mikmod mixer.c music.c music_cmd.c music_cmd.h music_mad.c music_mad.h music_ogg.c music_ogg.h native_midi native_midi_gpl playmus.c playwave.c timidity wavestream.c wavestream.h version.rc

@@ -57,28 +59,27 @@ Makefile: $(srcdir)/Makefile.in
$(objects):
$(SHELL) $(auxdir)/mkinstalldirs $@

.PHONY: all install install-hdrs install-lib install-bin uninstall uninstall-hdrs uninstall-lib uninstall-bin clean distclean dist

-include $(OBJECTS:.lo=.d)
@DEPENDS@
@VERSION_DEPENDS@

-include $(PLAYWAVE_OBJECTS:.lo=.d)
@PLAYWAVE_DEPENDS@

-include $(PLAYMUS_OBJECTS:.lo=.d)
@PLAYMUS_DEPENDS@

$(objects)/$(TARGET): $(OBJECTS) $(VERSION_OBJECTS)
$(LIBTOOL) --mode=link $(CC) -o $@ $(OBJECTS) $(VERSION_OBJECTS) $(LDFLAGS) $(EXTRA_LDFLAGS) $(LT_LDFLAGS)

$(objects)/playwave$(EXE): $(objects)/playwave.lo $(objects)/$(TARGET)
$(LIBTOOL) --mode=link $(CC) -o $@ $(objects)/playwave.lo $(SDL_CFLAGS) $(SDL_LIBS) $(objects)/$(TARGET)

$(objects)/playmus$(EXE): $(objects)/playmus.lo $(objects)/$(TARGET)
$(LIBTOOL) --mode=link $(CC) -o $@ $(objects)/playmus.lo $(SDL_CFLAGS) $(SDL_LIBS) $(objects)/$(TARGET)

.PHONY: all depend install install-hdrs install-lib install-bin uninstall uninstall-hdrs uninstall-lib uninstall-bin clean distclean dist
depend:
@SOURCES="$(SOURCES)" INCLUDE="$(INCLUDE)" output="$(depend)" \
$(SHELL) $(auxdir)/makedep.sh
echo "\$$(objects)/playwave.lo: \$$(srcdir)/playwave.c" >>$(depend)
echo " \$$(LIBTOOL) --mode=compile \$$(CC) \$$(CFLAGS) \$$(SDL_CFLAGS) -c \$$(srcdir)/playwave.c -o \$$@" >>$(depend)
echo "" >>$(depend)
echo "\$$(objects)/playmus.lo: \$$(srcdir)/playmus.c" >>$(depend)
echo " \$$(LIBTOOL) --mode=compile \$$(CC) \$$(CFLAGS) \$$(SDL_CFLAGS) -c \$$(srcdir)/playmus.c -o \$$@" >>$(depend)
echo "" >>$(depend)

include $(depend)

$(objects)/$(TARGET): $(OBJECTS)
$(LIBTOOL) --mode=link $(CC) -o $@ $(OBJECTS) $(LDFLAGS) $(EXTRA_LDFLAGS) $(LT_LDFLAGS)

install: all install-hdrs install-lib #install-bin
install-hdrs:
$(SHELL) $(auxdir)/mkinstalldirs $(includedir)/SDL
@@ -117,7 +118,7 @@ clean:
distclean: clean
rm -f Makefile
rm -f SDL_mixer.qpg
rm -f config.status config.cache config.log libtool $(depend)
rm -f config.status config.cache config.log libtool
rm -f SDL_mixer.pc
rm -rf $(srcdir)/autom4te*
find $(srcdir) \( \

This file was deleted.

@@ -87,7 +87,7 @@ AC_C_CONST

case "$host" in
*-*-cygwin* | *-*-mingw32*)
SOURCES="$srcdir/version.rc"
VERSION_SOURCES="$srcdir/version.rc"
EXE=".exe"
if test "$build" != "$host"; then # cross-compiling
# Default cross-compile location
@@ -485,13 +485,47 @@ if test x$have_smpeg != xyes -a x$have_libmad != xyes; then
AC_MSG_WARN([MP3 support disabled])
fi

OBJECTS=`echo $SOURCES | sed 's,[[^ ]]*/\([[^ ]]*\)\.c,$(objects)/\1.lo,g'`
OBJECTS=`echo $OBJECTS | sed 's,[[^ ]]*/\([[^ ]]*\)\.rc,$(objects)/\1.o,g'`

OBJECTS=`echo $SOURCES`
DEPENDS=`echo $SOURCES`
OBJECTS=`echo "$OBJECTS" | sed 's,[[^ ]]*/\([[^ ]]*\)\.c,$(objects)/\1.lo,g'`
DEPENDS=`echo "$DEPENDS" | sed 's,\([[^ ]]*\)/\([[^ ]]*\)\.c,\\
$(objects)/\2.lo: \1/\2.c\\
\$(LIBTOOL) --mode=compile \$(CC) \$(CFLAGS) \$(EXTRA_CFLAGS) -MMD -MT \$@ -c \$< -o \$@,g'`

VERSION_OBJECTS=`echo $VERSION_SOURCES`
VERSION_DEPENDS=`echo $VERSION_SOURCES`
VERSION_OBJECTS=`echo "$VERSION_OBJECTS" | sed 's,[[^ ]]*/\([[^ ]]*\)\.rc,$(objects)/\1.o,g'`
VERSION_DEPENDS=`echo "$VERSION_DEPENDS" | sed 's,\([[^ ]]*\)/\([[^ ]]*\)\.rc,\\
$(objects)/\2.o: \1/\2.rc\\
\$(WINDRES) \$< \$@,g'`

PLAYWAVE_SOURCES="$srcdir/playwave.c"
PLAYWAVE_OBJECTS=`echo $PLAYWAVE_SOURCES`
PLAYWAVE_DEPENDS=`echo $PLAYWAVE_SOURCES`
PLAYWAVE_OBJECTS=`echo "$PLAYWAVE_OBJECTS" | sed 's,[[^ ]]*/\([[^ ]]*\)\.c,$(objects)/\1.lo,g'`
PLAYWAVE_DEPENDS=`echo "$PLAYWAVE_DEPENDS" | sed 's,\([[^ ]]*\)/\([[^ ]]*\)\.c,\\
$(objects)/\2.lo: \1/\2.c\\
\$(LIBTOOL) --mode=compile \$(CC) \$(CFLAGS) \$(EXTRA_CFLAGS) -MMD -MT \$@ -c \$< -o \$@,g'`

PLAYMUS_SOURCES="$srcdir/playmus.c"
PLAYMUS_OBJECTS=`echo $PLAYMUS_SOURCES`
PLAYMUS_DEPENDS=`echo $PLAYMUS_SOURCES`
PLAYMUS_OBJECTS=`echo "$PLAYMUS_OBJECTS" | sed 's,[[^ ]]*/\([[^ ]]*\)\.c,$(objects)/\1.lo,g'`
PLAYMUS_DEPENDS=`echo "$PLAYMUS_DEPENDS" | sed 's,\([[^ ]]*\)/\([[^ ]]*\)\.c,\\
$(objects)/\2.lo: \1/\2.c\\
\$(LIBTOOL) --mode=compile \$(CC) \$(CFLAGS) \$(EXTRA_CFLAGS) -MMD -MT \$@ -c \$< -o \$@,g'`

dnl Expand the sources and objects needed to build the library
AC_SUBST(ac_aux_dir)
AC_SUBST(SOURCES)
AC_SUBST(OBJECTS)
AC_SUBST(DEPENDS)
AC_SUBST(VERSION_OBJECTS)
AC_SUBST(VERSION_DEPENDS)
AC_SUBST(PLAYWAVE_OBJECTS)
AC_SUBST(PLAYWAVE_DEPENDS)
AC_SUBST(PLAYMUS_OBJECTS)
AC_SUBST(PLAYMUS_DEPENDS)
AC_SUBST(BUILD_CFLAGS)
AC_SUBST(EXTRA_CFLAGS)
AC_SUBST(BUILD_LDFLAGS)
@@ -504,7 +538,4 @@ AC_SUBST(SDL_LIBS)

AC_OUTPUT([
Makefile SDL_mixer.spec SDL_mixer.qpg SDL_mixer.pc
], [
: >build-deps
if test x"$MAKE" = x; then MAKE=make; fi; $MAKE depend
])

0 comments on commit d3e429a

Please sign in to comment.