Makefile.in
author Sam Lantinga <slouken@libsdl.org>
Tue, 15 Mar 2011 23:26:22 -0700
changeset 5498 ef1db08c40ac
parent 5393 17da19f8ca05
child 6159 fb6f363032fd
permissions -rw-r--r--
Make it possible to run "make dist" from a separate build directory.
     1 # Makefile to build and install the SDL library
     2 
     3 top_builddir = .
     4 srcdir  = @srcdir@
     5 objects = build
     6 prefix = @prefix@
     7 exec_prefix = @exec_prefix@
     8 bindir	= @bindir@
     9 libdir  = @libdir@
    10 includedir = @includedir@
    11 datarootdir = @datarootdir@
    12 datadir	= @datadir@
    13 auxdir	= @ac_aux_dir@
    14 distpath = $(srcdir)/..
    15 distdir = SDL-@SDL_VERSION@
    16 distfile = $(distdir).tar.gz
    17 
    18 @SET_MAKE@
    19 SHELL	= @SHELL@
    20 CC      = @CC@
    21 INCLUDE = @INCLUDE@
    22 CFLAGS  = @BUILD_CFLAGS@
    23 EXTRA_CFLAGS = @EXTRA_CFLAGS@
    24 LDFLAGS = @BUILD_LDFLAGS@
    25 EXTRA_LDFLAGS = @EXTRA_LDFLAGS@
    26 LIBTOOL = @LIBTOOL@
    27 INSTALL = @INSTALL@
    28 AR	= @AR@
    29 RANLIB	= @RANLIB@
    30 WINDRES	= @WINDRES@
    31 
    32 TARGET  = libSDL.la
    33 OBJECTS = @OBJECTS@
    34 VERSION_OBJECTS = @VERSION_OBJECTS@
    35 
    36 SDLMAIN_TARGET = libSDLmain.a
    37 SDLMAIN_OBJECTS = @SDLMAIN_OBJECTS@
    38 
    39 SRC_DIST = acinclude Android.mk autogen.sh Borland.html Borland.zip BUGS build-scripts configure configure.in COPYING CREDITS include INSTALL Makefile.minimal Makefile.in README* sdl-config.in sdl.m4 sdl.pc.in SDL.spec.in src test TODO VisualC.html VisualC VisualCE Watcom-Win32.zip WhatsNew Xcode Xcode-iPhoneOS
    40 GEN_DIST = SDL.spec
    41 
    42 HDRS = \
    43 	SDL.h \
    44 	SDL_assert.h \
    45 	SDL_atomic.h \
    46 	SDL_audio.h \
    47 	SDL_blendmode.h \
    48 	SDL_clipboard.h \
    49 	SDL_compat.h \
    50 	SDL_cpuinfo.h \
    51 	SDL_endian.h \
    52 	SDL_error.h \
    53 	SDL_events.h \
    54 	SDL_gesture.h \
    55 	SDL_haptic.h \
    56 	SDL_hints.h \
    57 	SDL_input.h \
    58 	SDL_joystick.h \
    59 	SDL_keyboard.h \
    60 	SDL_keycode.h \
    61 	SDL_loadso.h \
    62 	SDL_log.h \
    63 	SDL_main.h \
    64 	SDL_mouse.h \
    65 	SDL_mutex.h \
    66 	SDL_name.h \
    67 	SDL_opengl.h \
    68 	SDL_opengles.h \
    69 	SDL_pixels.h \
    70 	SDL_platform.h \
    71 	SDL_power.h \
    72 	SDL_quit.h \
    73 	SDL_rect.h \
    74 	SDL_render.h \
    75 	SDL_rwops.h \
    76 	SDL_scancode.h \
    77 	SDL_shape.h \
    78 	SDL_stdinc.h \
    79 	SDL_surface.h \
    80 	SDL_syswm.h \
    81 	SDL_thread.h \
    82 	SDL_timer.h \
    83 	SDL_touch.h \
    84 	SDL_types.h \
    85 	SDL_version.h \
    86 	SDL_video.h \
    87 	begin_code.h \
    88 	close_code.h
    89 
    90 LT_AGE      = @LT_AGE@
    91 LT_CURRENT  = @LT_CURRENT@
    92 LT_RELEASE  = @LT_RELEASE@
    93 LT_REVISION = @LT_REVISION@
    94 LT_LDFLAGS  = -no-undefined -rpath $(DESTDIR)$(libdir) -release $(LT_RELEASE) -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE)
    95 
    96 all: $(srcdir)/configure Makefile $(objects) $(objects)/$(TARGET) $(objects)/$(SDLMAIN_TARGET)
    97 
    98 $(srcdir)/configure: $(srcdir)/configure.in
    99 	@echo "Warning, configure.in is out of date"
   100 	#(cd $(srcdir) && sh autogen.sh && sh configure)
   101 	@sleep 3
   102 
   103 Makefile: $(srcdir)/Makefile.in
   104 	$(SHELL) config.status $@
   105 
   106 Makefile.in:;
   107 
   108 $(objects):
   109 	$(SHELL) $(auxdir)/mkinstalldirs $@
   110 
   111 update-revision:
   112 	$(SHELL) $(auxdir)/updaterev.sh
   113 
   114 .PHONY: all update-revision install install-bin install-hdrs install-lib install-data uninstall uninstall-bin uninstall-hdrs uninstall-lib uninstall-data clean distclean dist $(OBJECTS:.lo=.d)
   115 
   116 $(objects)/$(TARGET): $(OBJECTS) $(VERSION_OBJECTS)
   117 	$(LIBTOOL) --mode=link $(CC) -o $@ $(OBJECTS) $(VERSION_OBJECTS) $(LDFLAGS) $(EXTRA_LDFLAGS) $(LT_LDFLAGS)
   118 
   119 $(objects)/$(SDLMAIN_TARGET): $(SDLMAIN_OBJECTS)
   120 	$(AR) cru $@ $(SDLMAIN_OBJECTS)
   121 	$(RANLIB) $@
   122 
   123 install: all install-bin install-hdrs install-lib install-data
   124 install-bin:
   125 	$(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(bindir)
   126 	$(INSTALL) -m 755 sdl-config $(DESTDIR)$(bindir)/sdl-config
   127 install-hdrs: update-revision
   128 	$(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(includedir)/SDL
   129 	for file in $(HDRS); do \
   130 	    $(INSTALL) -m 644 $(srcdir)/include/$$file $(DESTDIR)$(includedir)/SDL/$$file; \
   131 	done
   132 	$(INSTALL) -m 644 include/SDL_config.h $(DESTDIR)$(includedir)/SDL/SDL_config.h
   133 	if test -f include/SDL_revision.h; then \
   134 	    $(INSTALL) -m 644 include/SDL_revision.h $(DESTDIR)$(includedir)/SDL/SDL_revision.h; \
   135 	else \
   136 	    $(INSTALL) -m 644 $(srcdir)/include/SDL_revision.h $(DESTDIR)$(includedir)/SDL/SDL_revision.h; \
   137 	fi
   138 
   139 install-lib: $(objects) $(objects)/$(TARGET) $(objects)/$(SDLMAIN_TARGET)
   140 	$(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(libdir)
   141 	$(LIBTOOL) --mode=install $(INSTALL) $(objects)/$(TARGET) $(DESTDIR)$(libdir)/$(TARGET)
   142 	$(INSTALL) -m 644 $(objects)/$(SDLMAIN_TARGET) $(DESTDIR)$(libdir)/$(SDLMAIN_TARGET)
   143 	$(RANLIB) $(DESTDIR)$(libdir)/$(SDLMAIN_TARGET)
   144 install-data:
   145 	$(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(datadir)/aclocal
   146 	$(INSTALL) -m 644 $(srcdir)/sdl.m4 $(DESTDIR)$(datadir)/aclocal/sdl.m4
   147 	$(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(libdir)/pkgconfig
   148 	$(INSTALL) -m 644 sdl.pc $(DESTDIR)$(libdir)/pkgconfig
   149 
   150 uninstall: uninstall-bin uninstall-hdrs uninstall-lib uninstall-data
   151 uninstall-bin:
   152 	rm -f $(DESTDIR)$(bindir)/sdl-config
   153 uninstall-hdrs:
   154 	for file in $(HDRS); do \
   155 	    rm -f $(DESTDIR)$(includedir)/SDL/$$file; \
   156 	done
   157 	rm -f $(DESTDIR)$(includedir)/SDL/SDL_config.h
   158 	rm -f $(DESTDIR)$(includedir)/SDL/SDL_revision.h
   159 	-rmdir $(DESTDIR)$(includedir)/SDL
   160 uninstall-lib:
   161 	$(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$(TARGET)
   162 	rm -f $(DESTDIR)$(libdir)/$(SDLMAIN_TARGET)
   163 uninstall-data:
   164 	rm -f $(DESTDIR)$(datadir)/aclocal/sdl.m4
   165 	rm -f $(DESTDIR)$(libdir)/pkgconfig/sdl.pc
   166 
   167 clean:
   168 	rm -rf $(objects)
   169 	if test -f test/Makefile; then (cd test; $(MAKE) $@); fi
   170 
   171 distclean: clean
   172 	rm -f Makefile Makefile.rules sdl-config
   173 	rm -f SDL.qpg
   174 	rm -f config.status config.cache config.log libtool
   175 	rm -rf $(srcdir)/autom4te*
   176 	find $(srcdir) \( \
   177 	    -name '*~' -o \
   178 	    -name '*.bak' -o \
   179 	    -name '*.old' -o \
   180 	    -name '*.rej' -o \
   181 	    -name '*.orig' -o \
   182 	    -name '.#*' \) \
   183 	    -exec rm -f {} \;
   184 	if test -f test/Makefile; then (cd test; $(MAKE) $@); fi
   185 
   186 dist $(distfile):
   187 	$(SHELL) $(auxdir)/mkinstalldirs $(distdir)
   188 	(cd $(srcdir); tar cf - $(SRC_DIST)) | (cd $(distdir); tar xf -)
   189 	tar cf - $(GEN_DIST) | (cd $(distdir); tar xf -)
   190 	find $(distdir) \( \
   191 	    -name '*~' -o \
   192 	    -name '*.bak' -o \
   193 	    -name '*.old' -o \
   194 	    -name '*.rej' -o \
   195 	    -name '*.orig' -o \
   196 	    -name '.#*' \) \
   197 	    -exec rm -f {} \;
   198 	if test -f $(distdir)/test/Makefile; then (cd $(distdir)/test && make distclean); fi
   199 	tar cvf - $(distdir) | gzip --best >$(distfile)
   200 	rm -rf $(distdir)
   201 
   202 rpm: $(distfile)
   203 	rpmbuild -ta $?
   204 
   205 # Run indent on the source to standardize coding style
   206 indent:
   207 	@echo "Running indent... modified files:"
   208 	@cd $(srcdir) && \
   209 	find . \( \
   210 	    -name '*.h' -o \
   211 	    -name '*.c' -o \
   212 	    -name '*.cc' \) \
   213 	    -print | fgrep -v ./Xcode | \
   214 	while read file; do \
   215 	    indent "$$file" -o "$$file.indent"; \
   216 	    if cmp "$$file" "$$file.indent" >/dev/null; then \
   217 	        rm -f "$$file.indent"; \
   218 	    else \
   219 	        echo "$$file"; \
   220 	        mv -f "$$file.indent" "$$file"; \
   221 	    fi; \
   222 	done
   223 
   224 # Run indent and then commit modified files
   225 commit: indent
   226 	hg commit