1 # Makefile to build and install the SDL library
7 exec_prefix = @exec_prefix@
10 includedir = @includedir@
11 datarootdir = @datarootdir@
14 distpath = $(srcdir)/..
15 distdir = SDL-@SDL_VERSION@
16 distfile = $(distdir).tar.gz
22 CFLAGS = @BUILD_CFLAGS@
23 EXTRA_CFLAGS = @EXTRA_CFLAGS@
24 LDFLAGS = @BUILD_LDFLAGS@
25 EXTRA_LDFLAGS = @EXTRA_LDFLAGS@
28 NASM = @NASM@ @NASMFLAGS@
35 VERSION_OBJECTS = @VERSION_OBJECTS@
37 SDLMAIN_TARGET = libSDLmain.a
38 SDLMAIN_OBJECTS = @SDLMAIN_OBJECTS@
43 #include $(srcdir)/src/video/ps3/spulibs/Makefile
45 DIST = acinclude autogen.sh Borland.html Borland.zip BUGS build-scripts configure configure.in COPYING CREDITS docs.html include INSTALL Makefile.minimal Makefile.in README* sdl-config.in sdl.m4 sdl.pc.in SDL.spec SDL.spec.in src test TODO VisualC.html VisualC VisualCE Watcom-Win32.zip WhatsNew Xcode
47 HDRS = SDL.h SDL_atomic.h SDL_audio.h SDL_compat.h SDL_cpuinfo.h SDL_endian.h SDL_error.h SDL_events.h SDL_haptic.h SDL_joystick.h SDL_keyboard.h SDL_keysym.h SDL_loadso.h SDL_main.h SDL_mouse.h SDL_mutex.h SDL_name.h SDL_opengl.h SDL_opengles.h SDL_pixels.h SDL_platform.h SDL_power.h SDL_quit.h SDL_rect.h SDL_revision.h SDL_rwops.h SDL_scancode.h SDL_stdinc.h SDL_surface.h SDL_syswm.h SDL_thread.h SDL_timer.h SDL_types.h SDL_version.h SDL_video.h begin_code.h close_code.h
50 LT_CURRENT = @LT_CURRENT@
51 LT_RELEASE = @LT_RELEASE@
52 LT_REVISION = @LT_REVISION@
53 LT_LDFLAGS = -no-undefined -rpath $(DESTDIR)$(libdir) -release $(LT_RELEASE) -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE)
55 all: $(srcdir)/configure Makefile $(objects) $(objects)/$(TARGET) $(objects)/$(SDLMAIN_TARGET)
57 $(srcdir)/configure: $(srcdir)/configure.in
58 @echo "Warning, configure.in is out of date"
59 #(cd $(srcdir) && sh autogen.sh && sh configure)
62 Makefile: $(srcdir)/Makefile.in
63 $(SHELL) config.status $@
68 $(SHELL) $(auxdir)/mkinstalldirs $@
70 # To make sure parallel builds will not fail
71 $(srcdir)/include/SDL_revision.h: update-revision
74 $(SHELL) $(auxdir)/updaterev.sh
76 .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)
78 -include $(OBJECTS:.lo=.d)
83 $(objects)/$(TARGET): $(OBJECTS) $(VERSION_OBJECTS)
84 $(LIBTOOL) --mode=link $(CC) -o $@ $(OBJECTS) $(VERSION_OBJECTS) $(LDFLAGS) $(EXTRA_LDFLAGS) $(LT_LDFLAGS)
86 $(objects)/$(SDLMAIN_TARGET): $(SDLMAIN_OBJECTS)
87 $(AR) cru $@ $(SDLMAIN_OBJECTS)
90 install: all install-bin install-hdrs install-lib install-data
92 $(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(bindir)
93 $(INSTALL) -m 755 sdl-config $(DESTDIR)$(bindir)/sdl-config
95 $(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(includedir)/SDL
96 for file in $(HDRS); do \
97 $(INSTALL) -m 644 $(srcdir)/include/$$file $(DESTDIR)$(includedir)/SDL/$$file; \
99 $(INSTALL) -m 644 include/SDL_config.h $(DESTDIR)$(includedir)/SDL/SDL_config.h
100 install-lib: $(objects) $(objects)/$(TARGET) $(objects)/$(SDLMAIN_TARGET)
101 $(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(libdir)
102 $(LIBTOOL) --mode=install $(INSTALL) $(objects)/$(TARGET) $(DESTDIR)$(libdir)/$(TARGET)
103 $(INSTALL) -m 644 $(objects)/$(SDLMAIN_TARGET) $(DESTDIR)$(libdir)/$(SDLMAIN_TARGET)
104 $(RANLIB) $(DESTDIR)$(libdir)/$(SDLMAIN_TARGET)
106 $(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(datadir)/aclocal
107 $(INSTALL) -m 644 $(srcdir)/sdl.m4 $(DESTDIR)$(datadir)/aclocal/sdl.m4
108 $(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(libdir)/pkgconfig
109 $(INSTALL) -m 644 sdl.pc $(DESTDIR)$(libdir)/pkgconfig
111 uninstall: uninstall-bin uninstall-hdrs uninstall-lib uninstall-data
113 rm -f $(DESTDIR)$(bindir)/sdl-config
115 for file in $(HDRS); do \
116 rm -f $(DESTDIR)$(includedir)/SDL/$$file; \
118 rm -f $(DESTDIR)$(includedir)/SDL/SDL_config.h
119 -rmdir $(DESTDIR)$(includedir)/SDL
121 $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$(TARGET)
122 rm -f $(DESTDIR)$(libdir)/$(SDLMAIN_TARGET)
124 rm -f $(DESTDIR)$(datadir)/aclocal/sdl.m4
125 rm -f $(DESTDIR)$(libdir)/pkgconfig/sdl.pc
129 if test -f test/Makefile; then (cd test; $(MAKE) $@); fi
132 rm -f Makefile include/SDL_config.h sdl-config
134 rm -f config.status config.cache config.log libtool
135 rm -rf $(srcdir)/autom4te*
144 cp $(srcdir)/include/SDL_config.h.default $(srcdir)/include/SDL_config.h
145 if test -f test/Makefile; then (cd test; $(MAKE) $@); fi
148 $(SHELL) $(auxdir)/mkinstalldirs $(distdir)
149 tar cf - $(DIST) | (cd $(distdir); tar xf -)
150 cp $(distdir)/include/SDL_config.h.default $(distdir)/include/SDL_config.h
151 $(SHELL) $(distdir)/build-scripts/updaterev.sh
152 rm -rf `find $(distdir) -name .svn`
161 if test -f $(distdir)/test/Makefile; then (cd $(distdir)/test && make distclean); fi
162 tar cvf - $(distdir) | gzip --best >$(distfile)
168 # Run indent on the source to standardize coding style
170 @echo "Running indent... modified files:"
176 -print | fgrep -v ./Xcode | \
177 while read file; do \
178 indent "$$file" -o "$$file.indent"; \
179 if cmp "$$file" "$$file.indent" >/dev/null; then \
180 rm -f "$$file.indent"; \
183 mv -f "$$file.indent" "$$file"; \
187 # Run indent and then commit modified files
191 # Create a SVN snapshot that people can run update on
193 $(SHELL) $(auxdir)/snapshot.sh