Makefile.in
author Sam Lantinga <slouken@libsdl.org>
Mon, 06 Mar 2006 18:31:30 +0000
changeset 1476 14937d7b7527
parent 1451 b89bce877c0d
child 1485 e507811313ee
permissions -rw-r--r--
Date: Mon, 6 Mar 2006 19:00:45 +0100
From: Patrice Mandin
Subject: [SDL] Can not install generated sdl-config

When building SDL when builddir != srcdir, then make install fails,
because it tries to install sdl-config from srcdir, instead of builddir
     1 # Makefile to build and install the SDL library
     2 
     3 top_builddir = .
     4 srcdir  = @srcdir@
     5 objects = build
     6 depend	= build-deps
     7 prefix = @prefix@
     8 exec_prefix = @exec_prefix@
     9 bindir	= $(DESTDIR)@bindir@
    10 libdir  = $(DESTDIR)@libdir@
    11 includedir = $(DESTDIR)@includedir@
    12 datadir	= $(DESTDIR)@datadir@
    13 mandir	= $(DESTDIR)@mandir@
    14 auxdir	= @ac_aux_dir@
    15 distpath = $(srcdir)/..
    16 distdir = SDL-@SDL_VERSION@
    17 distfile = $(distdir).tar.gz
    18 
    19 @SET_MAKE@
    20 SHELL	= @SHELL@
    21 CC      = @CC@
    22 INCLUDE = @INCLUDE@
    23 CFLAGS  = @BUILD_CFLAGS@
    24 LDFLAGS = @BUILD_LDFLAGS@
    25 LIBTOOL = @LIBTOOL@
    26 INSTALL = @INSTALL@
    27 NASM	= @NASM@ @NASMFLAGS@
    28 AR	= @AR@
    29 RANLIB	= @RANLIB@
    30 
    31 TARGET  = libSDL.la
    32 SOURCES = @SOURCES@
    33 OBJECTS = @OBJECTS@
    34 
    35 SDLMAIN_TARGET = libSDLmain.a
    36 SDLMAIN_SOURCES = @SDLMAIN_SOURCES@
    37 SDLMAIN_OBJECTS = @SDLMAIN_OBJECTS@
    38 
    39 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 src test TODO VisualCE.zip VisualC.html VisualC.zip Watcom-OS2.zip WhatsNew Xcode21.tar.gz Xcode.tar.gz XcodeUniversal.tar.gz
    40 
    41 LT_AGE      = @LT_AGE@
    42 LT_CURRENT  = @LT_CURRENT@
    43 LT_RELEASE  = @LT_RELEASE@
    44 LT_REVISION = @LT_REVISION@
    45 LT_LDFLAGS  = -no-undefined -rpath $(libdir) -release $(LT_RELEASE) -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE)
    46 
    47 all: Makefile $(objects) $(objects)/$(TARGET) $(objects)/$(SDLMAIN_TARGET)
    48 
    49 Makefile: $(srcdir)/Makefile.in
    50 	$(SHELL) config.status $@
    51 
    52 $(objects):
    53 	$(SHELL) $(auxdir)/mkinstalldirs $@
    54 
    55 .PHONY: all depend install install-bin install-hdrs install-lib install-data install-man uninstall uninstall-bin uninstall-hdrs uninstall-lib uninstall-data uninstall-man clean distclean dist
    56 depend:
    57 	@SOURCES="$(SOURCES)" INCLUDE="$(INCLUDE)" objects="$(objects)" output="$(depend)" \
    58 	$(SHELL) $(auxdir)/makedep.sh
    59 	@for src in $(SDLMAIN_SOURCES); do \
    60 	    obj=`echo $$src | sed -e 's|.*/||' -e 's|\.[^\.]*$$|.o|'`; \
    61 	    echo "$(objects)/$$obj: $$src" >>$(depend); \
    62 	    echo "	\$$(CC) \$$(CFLAGS) -c $$src -o \$$@" >>$(depend); \
    63 	done
    64 
    65 include $(depend)
    66 
    67 $(objects)/$(TARGET): $(OBJECTS)
    68 	$(LIBTOOL) --mode=link $(CC) -o $@ $(OBJECTS) $(LDFLAGS) $(LIBS) $(LT_LDFLAGS)
    69 
    70 $(objects)/$(SDLMAIN_TARGET): $(SDLMAIN_OBJECTS)
    71 	$(AR) cru $@ $(SDLMAIN_OBJECTS)
    72 	$(RANLIB) $@
    73 
    74 install: install-bin install-hdrs install-lib install-data install-man
    75 install-bin:
    76 	$(SHELL) $(auxdir)/mkinstalldirs $(bindir)
    77 	$(INSTALL) -m 755 sdl-config $(bindir)/sdl-config
    78 install-hdrs:
    79 	$(SHELL) $(auxdir)/mkinstalldirs $(includedir)/SDL
    80 	for src in $(srcdir)/include/*.h; do \
    81 	    file=`echo $$src | sed -e 's|^.*/||'`; \
    82 	    $(INSTALL) -m 644 $$src $(includedir)/SDL/$$file; \
    83 	done
    84 	$(INSTALL) -m 644 include/SDL_config.h $(includedir)/SDL/SDL_config.h
    85 install-lib:
    86 	$(SHELL) $(auxdir)/mkinstalldirs $(libdir)
    87 	$(LIBTOOL) --mode=install $(INSTALL) $(objects)/$(TARGET) $(libdir)/$(TARGET)
    88 	$(INSTALL) -m 644 $(objects)/$(SDLMAIN_TARGET) $(libdir)/$(SDLMAIN_TARGET)
    89 	$(RANLIB) $(libdir)/$(SDLMAIN_TARGET)
    90 install-data:
    91 	$(SHELL) $(auxdir)/mkinstalldirs $(datadir)/aclocal
    92 	$(INSTALL) -m 644 $(srcdir)/sdl.m4 $(datadir)/aclocal/sdl.m4
    93 install-man:
    94 	$(SHELL) $(auxdir)/mkinstalldirs $(mandir)/man3
    95 	for src in $(srcdir)/docs/man3/*.3; do \
    96 	    file=`echo $$src | sed -e 's|^.*/||'`; \
    97 	    $(INSTALL) -m 644 $$src $(mandir)/man3/$$file; \
    98 	done
    99 
   100 uninstall: uninstall-bin uninstall-hdrs uninstall-lib uninstall-man
   101 uninstall-bin:
   102 	rm -f $(bindir)/sdl-config
   103 uninstall-hdrs:
   104 	for src in $(srcdir)/include/*.h; do \
   105 	    file=`echo $$src | sed -e 's|^.*/||'`; \
   106 	    rm -f $(includedir)/SDL/$$file; \
   107 	done
   108 	rm -f $(includedir)/SDL/SDL_config.h
   109 uninstall-lib:
   110 	$(LIBTOOL) --mode=uninstall rm -f $(libdir)/$(TARGET)
   111 	rm -f $(libdir)/$(SDLMAIN_TARGET)
   112 uninstall-data:
   113 	rm -f $(datadir)/aclocal/sdl.m4
   114 uninstall-man:
   115 	for src in $(srcdir)/docs/man3/*.3; do \
   116 	    file=`echo $$src | sed -e 's|^.*/||'`; \
   117 	    rm -f $(mandir)/man3/$$file; \
   118 	done
   119 
   120 clean:
   121 	rm -rf $(objects)
   122 	if test -f test/Makefile; then (cd test; $(MAKE) $@); fi
   123 
   124 distclean: clean
   125 	rm -f Makefile include/SDL_config.h sdl-config
   126 	rm -f SDL.qpg
   127 	rm -f config.status config.cache config.log libtool $(depend)
   128 	rm -rf $(srcdir)/autom4te*
   129 	find $(srcdir) \
   130 	    -name '*~' -o -name '*.bak' -o -name '*.old' -o -name '*.rej' -o \
   131 	    -name '.#*' \
   132 	    -exec rm -f {} \;
   133 	cp include/SDL_config.h.minimal include/SDL_config.h
   134 	if test -f test/Makefile; then (cd test; $(MAKE) $@); fi
   135 
   136 dist $(distfile):
   137 	$(SHELL) $(auxdir)/mkinstalldirs $(distdir)
   138 	tar cf - $(DIST) | (cd $(distdir); tar xf -)
   139 	rm -rf `find $(distdir) -name CVS`
   140 	rm -f `find $(distdir) -name '.cvsignore'`
   141 	rm -f `find $(distdir) -name '.#*'`
   142 	rmdir `find $(distdir) -type d -empty`
   143 	tar cvf - $(distdir) | gzip --best >$(distfile)
   144 	rm -rf $(distdir)
   145 
   146 rpm: $(distfile)
   147 	rpmbuild -ta $?
   148 
   149 # Create a CVS snapshot that people can run update -d on
   150 CVSROOT = :pserver:guest@libsdl.org:/home/sdlweb/libsdl.org/cvs
   151 snapshot:
   152 	cvs -d $(CVSROOT) login
   153 	cvs -d $(CVSROOT) checkout -P SDL12
   154 	(cd SDL12 && ./autogen.sh && rm -rf autom4te.cache)
   155 	mv SDL12 SDL-1.2
   156 	tar zcf $(HOME)/SDL-1.2.tar.gz SDL-1.2
   157 	rm -f $(HOME)/SDL-1.2.zip
   158 	zip -r $(HOME)/SDL-1.2.zip SDL-1.2
   159 	rm -rf SDL-1.2