src/main/Makefile.am
author Sam Lantinga
Mon, 06 Feb 2006 08:28:51 +0000
changeset 1330 450721ad5436
parent 1133 609c060fd2a2
child 1361 19418e4422cb
permissions -rw-r--r--
It's now possible to build SDL without any C runtime at all on Windows,
using Visual C++ 2005
     1 
     2 ## Makefile.am for the main() function in the SDL library
     3 #
     4 # This is necessary because some platforms have special program
     5 # entry points, which require special application initialization.
     6 
     7 ARCH_SUBDIRS = $(srcdir)/beos \
     8                $(srcdir)/epoc \
     9                $(srcdir)/dummy \
    10                $(srcdir)/macos \
    11                $(srcdir)/macosx \
    12                $(srcdir)/qtopia \
    13                $(srcdir)/win32
    14 
    15 # Build a separate library containing the main() entry point.
    16 lib_LIBRARIES = libSDLmain.a
    17 
    18 if TARGET_WIN32
    19 MAINLIB_ARCH_SRCS = win32/SDL_win32_main.c
    20 else
    21 if TARGET_MACOSX
    22 if USE_COCOA
    23 MAINLIB_ARCH_SRCS = macosx/SDLMain.m macosx/SDLMain.h
    24 else
    25 if USE_CARBON
    26 MAINLIB_ARCH_SRCS = macos/SDL_main.c
    27 endif # USE_CARBON
    28 endif # USE_COCOA
    29 else
    30 if TARGET_QTOPIA
    31 MAINLIB_ARCH_SRCS = qtopia/SDL_qtopia_main.cc
    32 else
    33 MAINLIB_ARCH_SRCS = dummy/SDL_dummy_main.c
    34 endif # !TARGET_QTOPIA
    35 endif # !TARGET_MACOSX
    36 endif # !TARGET_WIN32
    37 libSDLmain_a_SOURCES = $(MAINLIB_ARCH_SRCS)
    38 
    39 # Build an internal library of any special app setup functions
    40 noinst_LTLIBRARIES = libarch.la
    41 
    42 if TARGET_BEOS
    43 ARCH_SRCS = beos/SDL_BeApp.cc beos/SDL_BeApp.h
    44 else
    45 ARCH_SRCS = arch.c
    46 endif
    47 
    48 libarch_la_SOURCES = $(ARCH_SRCS)
    49 
    50 exports:
    51 	for i in $(ARCH_SUBDIRS); do if [ -d $$i/exports ]; then (cd $$i/exports; make); fi; done
    52 
    53 # The architecture specific directories need to be copied into place
    54 # when building a distribution.
    55 dist-hook:
    56 	(cd $(distdir) && rm -f $(BUILT_SOURCES))
    57 	cp -rp $(ARCH_SUBDIRS) $(distdir)
    58 	(cd $(distdir) && rm -rf `find . -name CVS`)