Makefile.in
author Sam Lantinga <slouken@libsdl.org>
Sat, 14 Jan 2012 13:21:19 -0500
changeset 6217 6952b11b7f46
parent 6205 7dd8ea9f282d
child 6235 d169541f5049
permissions -rw-r--r--
Make sure that we use consistent configuration options on platforms like Windows so that command line builds and IDE builds have ABI compatibility.
Make sure we don't clobber SDL_revision.h when building from Mercurial
     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-iOS
    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_config.h \
    50 	SDL_config_android.h \
    51 	SDL_config_iphoneos.h \
    52 	SDL_config_macosx.h \
    53 	SDL_config_minimal.h \
    54 	SDL_config_nintendods.h \
    55 	SDL_config_windows.h \
    56 	SDL_compat.h \
    57 	SDL_cpuinfo.h \
    58 	SDL_endian.h \
    59 	SDL_error.h \
    60 	SDL_events.h \
    61 	SDL_gesture.h \
    62 	SDL_haptic.h \
    63 	SDL_hints.h \
    64 	SDL_input.h \
    65 	SDL_joystick.h \
    66 	SDL_keyboard.h \
    67 	SDL_keycode.h \
    68 	SDL_loadso.h \
    69 	SDL_log.h \
    70 	SDL_main.h \
    71 	SDL_mouse.h \
    72 	SDL_mutex.h \
    73 	SDL_name.h \
    74 	SDL_opengl.h \
    75 	SDL_opengles.h \
    76 	SDL_opengles2.h \
    77 	SDL_pixels.h \
    78 	SDL_platform.h \
    79 	SDL_power.h \
    80 	SDL_quit.h \
    81 	SDL_rect.h \
    82 	SDL_render.h \
    83 	SDL_rwops.h \
    84 	SDL_scancode.h \
    85 	SDL_shape.h \
    86 	SDL_stdinc.h \
    87 	SDL_surface.h \
    88 	SDL_syswm.h \
    89 	SDL_thread.h \
    90 	SDL_timer.h \
    91 	SDL_touch.h \
    92 	SDL_types.h \
    93 	SDL_version.h \
    94 	SDL_video.h \
    95 	begin_code.h \
    96 	close_code.h
    97 
    98 LT_AGE      = @LT_AGE@
    99 LT_CURRENT  = @LT_CURRENT@
   100 LT_RELEASE  = @LT_RELEASE@
   101 LT_REVISION = @LT_REVISION@
   102 LT_LDFLAGS  = -no-undefined -rpath $(DESTDIR)$(libdir) -release $(LT_RELEASE) -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE)
   103 
   104 all: $(srcdir)/configure Makefile $(objects) $(objects)/$(TARGET) $(objects)/$(SDLMAIN_TARGET)
   105 
   106 $(srcdir)/configure: $(srcdir)/configure.in
   107 	@echo "Warning, configure.in is out of date"
   108 	#(cd $(srcdir) && sh autogen.sh && sh configure)
   109 	@sleep 3
   110 
   111 Makefile: $(srcdir)/Makefile.in
   112 	$(SHELL) config.status $@
   113 
   114 Makefile.in:;
   115 
   116 $(objects):
   117 	$(SHELL) $(auxdir)/mkinstalldirs $@
   118 
   119 update-revision:
   120 	$(SHELL) $(auxdir)/updaterev.sh
   121 
   122 .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)
   123 
   124 $(objects)/$(TARGET): $(OBJECTS) $(VERSION_OBJECTS)
   125 	$(LIBTOOL) --mode=link $(CC) -o $@ $(OBJECTS) $(VERSION_OBJECTS) $(LDFLAGS) $(EXTRA_LDFLAGS) $(LT_LDFLAGS)
   126 
   127 $(objects)/$(SDLMAIN_TARGET): $(SDLMAIN_OBJECTS)
   128 	$(AR) cru $@ $(SDLMAIN_OBJECTS)
   129 	$(RANLIB) $@
   130 
   131 install: all install-bin install-hdrs install-lib install-data
   132 install-bin:
   133 	$(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(bindir)
   134 	$(INSTALL) -m 755 sdl-config $(DESTDIR)$(bindir)/sdl-config
   135 install-hdrs: update-revision
   136 	$(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(includedir)/SDL
   137 	for file in $(HDRS); do \
   138 	    $(INSTALL) -m 644 $(srcdir)/include/$$file $(DESTDIR)$(includedir)/SDL/$$file; \
   139 	done
   140 	$(INSTALL) -m 644 include/SDL_config_generated.h $(DESTDIR)$(includedir)/SDL/SDL_config_generated.h
   141 	if test -f include/SDL_revision.h; then \
   142 	    $(INSTALL) -m 644 include/SDL_revision.h $(DESTDIR)$(includedir)/SDL/SDL_revision.h; \
   143 	else \
   144 	    $(INSTALL) -m 644 $(srcdir)/include/SDL_revision.h $(DESTDIR)$(includedir)/SDL/SDL_revision.h; \
   145 	fi
   146 
   147 install-lib: $(objects) $(objects)/$(TARGET) $(objects)/$(SDLMAIN_TARGET)
   148 	$(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(libdir)
   149 	$(LIBTOOL) --mode=install $(INSTALL) $(objects)/$(TARGET) $(DESTDIR)$(libdir)/$(TARGET)
   150 	$(INSTALL) -m 644 $(objects)/$(SDLMAIN_TARGET) $(DESTDIR)$(libdir)/$(SDLMAIN_TARGET)
   151 	$(RANLIB) $(DESTDIR)$(libdir)/$(SDLMAIN_TARGET)
   152 install-data:
   153 	$(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(datadir)/aclocal
   154 	$(INSTALL) -m 644 $(srcdir)/sdl.m4 $(DESTDIR)$(datadir)/aclocal/sdl.m4
   155 	$(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(libdir)/pkgconfig
   156 	$(INSTALL) -m 644 sdl.pc $(DESTDIR)$(libdir)/pkgconfig
   157 
   158 uninstall: uninstall-bin uninstall-hdrs uninstall-lib uninstall-data
   159 uninstall-bin:
   160 	rm -f $(DESTDIR)$(bindir)/sdl-config
   161 uninstall-hdrs:
   162 	for file in $(HDRS); do \
   163 	    rm -f $(DESTDIR)$(includedir)/SDL/$$file; \
   164 	done
   165 	rm -f $(DESTDIR)$(includedir)/SDL/SDL_config_generated.h
   166 	rm -f $(DESTDIR)$(includedir)/SDL/SDL_revision.h
   167 	-rmdir $(DESTDIR)$(includedir)/SDL
   168 uninstall-lib:
   169 	$(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$(TARGET)
   170 	rm -f $(DESTDIR)$(libdir)/$(SDLMAIN_TARGET)
   171 uninstall-data:
   172 	rm -f $(DESTDIR)$(datadir)/aclocal/sdl.m4
   173 	rm -f $(DESTDIR)$(libdir)/pkgconfig/sdl.pc
   174 
   175 clean:
   176 	rm -rf $(objects)
   177 	if test -f test/Makefile; then (cd test; $(MAKE) $@); fi
   178 
   179 distclean: clean
   180 	rm -f Makefile Makefile.rules sdl-config
   181 	rm -f SDL.qpg
   182 	rm -f config.status config.cache config.log libtool
   183 	rm -rf $(srcdir)/autom4te*
   184 	find $(srcdir) \( \
   185 	    -name '*~' -o \
   186 	    -name '*.bak' -o \
   187 	    -name '*.old' -o \
   188 	    -name '*.rej' -o \
   189 	    -name '*.orig' -o \
   190 	    -name '.#*' \) \
   191 	    -exec rm -f {} \;
   192 	if test -f test/Makefile; then (cd test; $(MAKE) $@); fi
   193 
   194 dist $(distfile):
   195 	$(SHELL) $(auxdir)/mkinstalldirs $(distdir)
   196 	(cd $(srcdir); tar cf - $(SRC_DIST)) | (cd $(distdir); tar xf -)
   197 	tar cf - $(GEN_DIST) | (cd $(distdir); tar xf -)
   198 	find $(distdir) \( \
   199 	    -name '*~' -o \
   200 	    -name '*.bak' -o \
   201 	    -name '*.old' -o \
   202 	    -name '*.rej' -o \
   203 	    -name '*.orig' -o \
   204 	    -name '.#*' \) \
   205 	    -exec rm -f {} \;
   206 	if test -f $(distdir)/test/Makefile; then (cd $(distdir)/test && make distclean); fi
   207 	tar cvf - $(distdir) | gzip --best >$(distfile)
   208 	rm -rf $(distdir)
   209 
   210 rpm: $(distfile)
   211 	rpmbuild -ta $?
   212 
   213 # Run indent on the source to standardize coding style
   214 indent:
   215 	@echo "Running indent... modified files:"
   216 	@cd $(srcdir) && \
   217 	find . \( \
   218 	    -name '*.h' -o \
   219 	    -name '*.c' -o \
   220 	    -name '*.cc' \) \
   221 	    -print | fgrep -v ./Xcode | \
   222 	while read file; do \
   223 	    indent "$$file" -o "$$file.indent"; \
   224 	    if cmp "$$file" "$$file.indent" >/dev/null; then \
   225 	        rm -f "$$file.indent"; \
   226 	    else \
   227 	        echo "$$file"; \
   228 	        mv -f "$$file.indent" "$$file"; \
   229 	    fi; \
   230 	done
   231 
   232 # Run indent and then commit modified files
   233 commit: indent
   234 	hg commit