Added rules to build libSDLmain.a
authorSam Lantinga <slouken@libsdl.org>
Mon, 20 Feb 2006 22:15:38 +0000
changeset 1397b189a73aa335
parent 1396 428c8690cf73
child 1398 27b719501eb4
Added rules to build libSDLmain.a
Reverted Patrice's mint changes - you should fix the source files, not
add include paths to the build process.
Makefile.in
configure.in
     1.1 --- a/Makefile.in	Mon Feb 20 20:53:52 2006 +0000
     1.2 +++ b/Makefile.in	Mon Feb 20 22:15:38 2006 +0000
     1.3 @@ -30,6 +30,10 @@
     1.4  SOURCES = @SOURCES@
     1.5  OBJECTS = @OBJECTS@
     1.6  
     1.7 +SDLMAIN_TARGET = libSDLmain.a
     1.8 +SDLMAIN_SOURCES = @SDLMAIN_SOURCES@
     1.9 +SDLMAIN_OBJECTS = @SDLMAIN_OBJECTS@
    1.10 +
    1.11  DIST = acinclude.m4 autogen.sh Borland.html Borland.zip BUGS build-scripts configure configure.in COPYING CREDITS CWprojects.sea.bin docs docs.html EpocBuildFiles.zip include INSTALL Makefile.dc Makefile.in MPWmake.sea.bin PBProjects.tar.gz README* sdl-config.in sdl.m4 SDL.qpg.in SDL.spec SDL.spec.in setvars.cmd src test TODO VisualCE.zip VisualC.html VisualC.zip Watcom.mif WhatsNew Xcode21.tar.gz Xcode.tar.gz XcodeUniversal.tar.gz
    1.12  
    1.13  LT_AGE      = @LT_AGE@
    1.14 @@ -38,7 +42,7 @@
    1.15  LT_REVISION = @LT_REVISION@
    1.16  LT_LDFLAGS  = -no-undefined -rpath $(libdir) -release $(LT_RELEASE) -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE)
    1.17  
    1.18 -all: Makefile $(objects) $(objects)/$(TARGET)
    1.19 +all: Makefile $(objects) $(objects)/$(TARGET) $(objects)/$(TARGET_SDLMAIN)
    1.20  
    1.21  Makefile: $(srcdir)/Makefile.in
    1.22  	$(SHELL) config.status $@
    1.23 @@ -50,12 +54,21 @@
    1.24  depend:
    1.25  	SOURCES="$(SOURCES)" INCLUDE="$(INCLUDE)" objects="$(objects)" output="$(depend)" \
    1.26  	$(SHELL) $(auxdir)/makedep.sh
    1.27 +	for src in $(SDLMAIN_SOURCES); do \
    1.28 +	    obj=`echo $$src | sed -e 's|.*/||' -e 's|\.[^\.]*$$|.o|'`; \
    1.29 +	    echo "$(objects)/$$obj: $$src" >>$(depend); \
    1.30 +	    echo "	\$$(CC) \$$(CFLAGS) -c $$src -o \$$@" >>$(depend); \
    1.31 +	done
    1.32  
    1.33  include $(depend)
    1.34  
    1.35  $(objects)/$(TARGET): $(OBJECTS)
    1.36  	$(LIBTOOL) --mode=link $(CC) -o $@ $(OBJECTS) $(LDFLAGS) $(LIBS) $(LT_LDFLAGS)
    1.37  
    1.38 +$(objects)/$(SDLMAIN_TARGET): $(SDLMAIN_OBJECTS)
    1.39 +	@AR@ cru $@ $(SDLMAIN_OBJECTS)
    1.40 +	@RANLIB@ $@
    1.41 +
    1.42  install: install-bin install-hdrs install-lib install-data install-man
    1.43  install-bin:
    1.44  	$(SHELL) $(auxdir)/mkinstalldirs $(bindir)
    1.45 @@ -70,6 +83,7 @@
    1.46  install-lib:
    1.47  	$(SHELL) $(auxdir)/mkinstalldirs $(libdir)
    1.48  	$(LIBTOOL) --mode=install $(INSTALL) $(objects)/$(TARGET) $(libdir)/$(TARGET)
    1.49 +	$(INSTALL) -m 644 $(objects)/$(SDLMAIN_TARGET) $(libdir)/$(SDLMAIN_TARGET)
    1.50  install-data:
    1.51  	$(SHELL) $(auxdir)/mkinstalldirs $(datadir)/aclocal
    1.52  	$(INSTALL) -m 644 $(srcdir)/sdl.m4 $(datadir)/aclocal/sdl.m4
    1.53 @@ -91,6 +105,7 @@
    1.54  	rm -f $(includedir)/SDL/SDL_config.h
    1.55  uninstall-lib:
    1.56  	$(LIBTOOL) --mode=uninstall rm -f $(libdir)/$(TARGET)
    1.57 +	rm -f $(libdir)/$(SDLMAIN_TARGET)
    1.58  uninstall-data:
    1.59  	rm -f $(datadir)/aclocal/sdl.m4
    1.60  uninstall-man:
    1.61 @@ -121,6 +136,7 @@
    1.62  	rm -rf `find $(distdir) -name CVS`
    1.63  	rm -f `find $(distdir) -name '.cvsignore'`
    1.64  	rm -f `find $(distdir) -name '.#*'`
    1.65 +	rmdir `find $(distdir) -type d -empty`
    1.66  	tar cvf - $(distdir) | gzip --best >$(distfile)
    1.67  	rm -rf $(distdir)
    1.68  
     2.1 --- a/configure.in	Mon Feb 20 20:53:52 2006 +0000
     2.2 +++ b/configure.in	Mon Feb 20 22:15:38 2006 +0000
     2.3 @@ -1175,6 +1175,7 @@
     2.4          if test x$video_qtopia = xyes; then
     2.5              AC_DEFINE(SDL_VIDEO_DRIVER_QTOPIA)
     2.6              SOURCES="$SOURCES $srcdir/src/video/qtopia/*.cc"
     2.7 +            SDLMAIN_SOURCES="$srcdir/src/main/qtopia/*.cc"
     2.8              BUILD_CFLAGS="$BUILD_CFLAGS $QTOPIA_FLAGS"
     2.9              SDL_CFLAGS="$SDL_CFLAGS -DQWS -Dmain=SDL_main"
    2.10              SDL_LIBS="-lSDLmain $SDL_LIBS -L${QPEDIR}/lib -L${QTDIR}/lib/ -lqpe -lqte"
    2.11 @@ -2117,6 +2118,7 @@
    2.12              BUILD_LDFLAGS="$BUILD_LDFLAGS -ldxguid"
    2.13          fi
    2.14          # The Win32 platform requires special setup
    2.15 +        SDLMAIN_SOURCES="$srcdir/src/main/win32/*.c"
    2.16          SDL_CFLAGS="$SDL_CFLAGS -Dmain=SDL_main"
    2.17          SDL_LIBS="-lmingw32 -lSDLmain $SDL_LIBS -mwindows"
    2.18          ;;
    2.19 @@ -2219,6 +2221,7 @@
    2.20              have_loadso=yes
    2.21          fi
    2.22          # The MacOS X platform requires special setup.
    2.23 +        SDLMAIN_SOURCES="$srcdir/src/main/macosx/*.m"
    2.24          AC_DEFINE(TARGET_API_MAC_CARBON)
    2.25          BUILD_CFLAGS="$BUILD_CFLAGS -fpascal-strings -DMACOSX"
    2.26          SDL_LIBS="-lSDLmain $SDL_LIBS"
    2.27 @@ -2274,13 +2277,11 @@
    2.28              else
    2.29                  AC_DEFINE(SDL_TIMER_MINT)
    2.30                  SOURCES="$SOURCES $srcdir/src/timer/mint/*.c"
    2.31 -                BUILD_CFLAGS="$BUILD_CFLAGS -I$srcdir/src/timer/mint"
    2.32              fi
    2.33              have_timers=yes
    2.34          fi
    2.35          # MiNT does not define "unix"
    2.36          BUILD_CFLAGS="$BUILD_CFLAGS -Dunix"
    2.37 -        BUILD_CFLAGS="$BUILD_CFLAGS -I$srcdir/src/video/ataricommon"
    2.38          ;;
    2.39      *-riscos)
    2.40          ARCH=riscos
    2.41 @@ -2345,12 +2346,19 @@
    2.42      fi
    2.43      SOURCES="$SOURCES $srcdir/src/loadso/dummy/*.c"
    2.44  fi
    2.45 +if test x$SDLMAIN_SOURCES = x; then
    2.46 +    SDLMAIN_SOURCES="$srcdir/src/main/dummy/*.c"
    2.47 +fi
    2.48  
    2.49  OBJECTS=`echo $SOURCES | sed 's,[[^ ]]*/\([[^ ]]*\)\.asm,$(objects)/\1.lo,g'`
    2.50  OBJECTS=`echo $OBJECTS | sed 's,[[^ ]]*/\([[^ ]]*\)\.cc,$(objects)/\1.lo,g'`
    2.51  OBJECTS=`echo $OBJECTS | sed 's,[[^ ]]*/\([[^ ]]*\)\.m,$(objects)/\1.lo,g'`
    2.52  OBJECTS=`echo $OBJECTS | sed 's,[[^ ]]*/\([[^ ]]*\)\.c,$(objects)/\1.lo,g'`
    2.53  
    2.54 +SDLMAIN_OBJECTS=`echo $SDLMAIN_SOURCES | sed 's,[[^ ]]*/\([[^ ]]*\)\.cc,$(objects)/\1.o,g'`
    2.55 +SDLMAIN_OBJECTS=`echo $SDLMAIN_OBJECTS | sed 's,[[^ ]]*/\([[^ ]]*\)\.m,$(objects)/\1.o,g'`
    2.56 +SDLMAIN_OBJECTS=`echo $SDLMAIN_OBJECTS | sed 's,[[^ ]]*/\([[^ ]]*\)\.c,$(objects)/\1.o,g'`
    2.57 +
    2.58  # Set runtime shared library paths as needed
    2.59  
    2.60  if test "x$enable_rpath" = "xyes"; then
    2.61 @@ -2434,6 +2442,8 @@
    2.62  AC_SUBST(INCLUDE)
    2.63  AC_SUBST(SOURCES)
    2.64  AC_SUBST(OBJECTS)
    2.65 +AC_SUBST(SDLMAIN_SOURCES)
    2.66 +AC_SUBST(SDLMAIN_OBJECTS)
    2.67  AC_SUBST(BUILD_CFLAGS)
    2.68  AC_SUBST(BUILD_LDFLAGS)
    2.69