1 # Makefile to build and install the SDL library
8 exec_prefix = @exec_prefix@
11 includedir = @includedir@
12 datarootdir = @datarootdir@
15 distpath = $(srcdir)/..
16 distdir = SDL2-@SDL_VERSION@
17 distfile = $(distdir).tar.gz
23 CFLAGS = @BUILD_CFLAGS@
24 EXTRA_CFLAGS = @EXTRA_CFLAGS@
25 LDFLAGS = @BUILD_LDFLAGS@
26 EXTRA_LDFLAGS = @EXTRA_LDFLAGS@
35 GEN_HEADERS = @GEN_HEADERS@
36 GEN_OBJECTS = @GEN_OBJECTS@
37 VERSION_OBJECTS = @VERSION_OBJECTS@
39 SDLMAIN_TARGET = libSDL2main.la
40 SDLMAIN_OBJECTS = @SDLMAIN_OBJECTS@
42 SDLTEST_TARGET = libSDL2_test.la
43 SDLTEST_OBJECTS = @SDLTEST_OBJECTS@
45 WAYLAND_SCANNER = @WAYLAND_SCANNER@
47 INSTALL_SDL2_CONFIG = @INSTALL_SDL2_CONFIG@
49 SRC_DIST = *.txt acinclude Android.mk autogen.sh android-project build-scripts cmake cmake_uninstall.cmake.in configure configure.ac debian docs include Makefile.* sdl2-config.cmake.in sdl2-config-version.cmake.in sdl2-config.in sdl2.m4 sdl2.pc.in SDL2.spec.in SDL2Config.cmake src test VisualC.html VisualC VisualC-WinRT Xcode Xcode-iOS wayland-protocols
53 RUN_CMD_AR = @echo " AR " $@;
54 RUN_CMD_CC = @echo " CC " $@;
55 RUN_CMD_CXX = @echo " CXX " $@;
56 RUN_CMD_LTLINK = @echo " LTLINK" $@;
57 RUN_CMD_RANLIB = @echo " RANLIB" $@;
58 RUN_CMD_RC = @echo " RC " $@;
59 RUN_CMD_GEN = @echo " GEN " $@;
77 SDL_gamecontroller.h \
97 SDL_opengles2_gl2ext.h \
99 SDL_opengles2_gl2platform.h \
101 SDL_opengles2_khrplatform.h \
126 SDLTEST_HDRS = $(shell ls $(srcdir)/include | fgrep SDL_test)
129 LT_CURRENT = @LT_CURRENT@
130 LT_RELEASE = @LT_RELEASE@
131 LT_REVISION = @LT_REVISION@
132 LT_LDFLAGS = -no-undefined -rpath $(libdir) -release $(LT_RELEASE) -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE)
134 all: $(srcdir)/configure Makefile $(objects)/$(TARGET) $(objects)/$(SDLMAIN_TARGET) $(objects)/$(SDLTEST_TARGET)
136 $(srcdir)/configure: $(srcdir)/configure.ac
137 @echo "Warning, configure is out of date, please re-run autogen.sh"
139 Makefile: $(srcdir)/Makefile.in
140 $(SHELL) config.status $@
145 $(SHELL) $(auxdir)/mkinstalldirs $(objects)
149 $(SHELL) $(auxdir)/updaterev.sh
151 .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)
153 $(objects)/$(TARGET): $(GEN_HEADERS) $(GEN_OBJECTS) $(OBJECTS) $(VERSION_OBJECTS)
154 $(RUN_CMD_LTLINK)$(LIBTOOL) --tag=CC --mode=link $(CC) -o $@ $(OBJECTS) $(GEN_OBJECTS) $(VERSION_OBJECTS) $(LDFLAGS) $(EXTRA_LDFLAGS) $(LT_LDFLAGS)
156 $(objects)/$(SDLMAIN_TARGET): $(SDLMAIN_OBJECTS)
157 $(RUN_CMD_LTLINK)$(LIBTOOL) --tag=CC --mode=link $(CC) -static -o $@ $(SDLMAIN_OBJECTS) -rpath $(libdir)
159 $(objects)/$(SDLTEST_TARGET): $(SDLTEST_OBJECTS)
160 $(RUN_CMD_LTLINK)$(LIBTOOL) --tag=CC --mode=link $(CC) -static -o $@ $(SDLTEST_OBJECTS) -rpath $(libdir)
162 install: all install-bin install-hdrs install-lib install-data
164 ifeq ($(INSTALL_SDL2_CONFIG),TRUE)
165 $(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(bindir)
166 $(INSTALL) -m 755 sdl2-config $(DESTDIR)$(bindir)/sdl2-config
169 install-hdrs: update-revision
170 $(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(includedir)/SDL2
171 for file in $(HDRS) $(SDLTEST_HDRS); do \
172 $(INSTALL) -m 644 $(srcdir)/include/$$file $(DESTDIR)$(includedir)/SDL2/$$file; \
174 $(INSTALL) -m 644 include/SDL_config.h $(DESTDIR)$(includedir)/SDL2/SDL_config.h
175 if test -f include/SDL_revision.h; then \
176 $(INSTALL) -m 644 include/SDL_revision.h $(DESTDIR)$(includedir)/SDL2/SDL_revision.h; \
178 $(INSTALL) -m 644 $(srcdir)/include/SDL_revision.h $(DESTDIR)$(includedir)/SDL2/SDL_revision.h; \
181 install-lib: $(objects)/$(TARGET) $(objects)/$(SDLMAIN_TARGET) $(objects)/$(SDLTEST_TARGET)
182 $(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(libdir)
183 $(LIBTOOL) --mode=install $(INSTALL) $(objects)/$(TARGET) $(DESTDIR)$(libdir)/$(TARGET)
184 $(LIBTOOL) --mode=install $(INSTALL) $(objects)/$(SDLMAIN_TARGET) $(DESTDIR)$(libdir)/$(SDLMAIN_TARGET)
185 $(LIBTOOL) --mode=install $(INSTALL) $(objects)/$(SDLTEST_TARGET) $(DESTDIR)$(libdir)/$(SDLTEST_TARGET)
187 $(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(datadir)/aclocal
188 $(INSTALL) -m 644 $(srcdir)/sdl2.m4 $(DESTDIR)$(datadir)/aclocal/sdl2.m4
189 $(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(libdir)/pkgconfig
190 $(INSTALL) -m 644 sdl2.pc $(DESTDIR)$(libdir)/pkgconfig
191 ifeq ($(INSTALL_SDL2_CONFIG),TRUE)
192 $(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(libdir)/cmake/SDL2
193 $(INSTALL) -m 644 sdl2-config.cmake $(DESTDIR)$(libdir)/cmake/SDL2
194 $(INSTALL) -m 644 sdl2-config-version.cmake $(DESTDIR)$(libdir)/cmake/SDL2
197 uninstall: uninstall-bin uninstall-hdrs uninstall-lib uninstall-data
199 rm -f $(DESTDIR)$(bindir)/sdl2-config
201 for file in $(HDRS) $(SDLTEST_HDRS); do \
202 rm -f $(DESTDIR)$(includedir)/SDL2/$$file; \
204 rm -f $(DESTDIR)$(includedir)/SDL2/SDL_config.h
205 rm -f $(DESTDIR)$(includedir)/SDL2/SDL_revision.h
206 -rmdir $(DESTDIR)$(includedir)/SDL2
208 $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$(TARGET)
209 rm -f $(DESTDIR)$(libdir)/$(SDLMAIN_TARGET)
210 rm -f $(DESTDIR)$(libdir)/$(SDLTEST_TARGET)
212 rm -f $(DESTDIR)$(datadir)/aclocal/sdl2.m4
213 rm -f $(DESTDIR)$(libdir)/pkgconfig/sdl2.pc
214 rm -f $(DESTDIR)$(libdir)/cmake/SDL2/sdl2-config.cmake
215 rm -f $(DESTDIR)$(libdir)/cmake/SDL2/sdl2-config-version.cmake
220 if test -f test/Makefile; then (cd test; $(MAKE) $@); fi
223 rm -f Makefile Makefile.rules sdl2-config
224 rm -f config.status config.cache config.log libtool
225 rm -rf $(srcdir)/autom4te*
234 if test -f test/Makefile; then (cd test; $(MAKE) $@); fi
237 $(SHELL) $(auxdir)/mkinstalldirs $(distdir)
238 (cd $(srcdir); tar cf - $(SRC_DIST)) | (cd $(distdir); tar xf -)
239 tar cf - $(GEN_DIST) | (cd $(distdir); tar xf -)
248 if test -f $(distdir)/test/Makefile; then (cd $(distdir)/test && make distclean); fi
249 (cd $(distdir); build-scripts/updaterev.sh)
250 tar cvf - $(distdir) | gzip --best >$(distfile)