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 = SDL2-@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@
34 VERSION_OBJECTS = @VERSION_OBJECTS@
36 SDLMAIN_TARGET = libSDL2main.a
37 SDLMAIN_OBJECTS = @SDLMAIN_OBJECTS@
39 SDLTEST_TARGET = libSDL2_test.a
40 SDLTEST_OBJECTS = @SDLTEST_OBJECTS@
42 SRC_DIST = *.txt acinclude Android.mk autogen.sh android-project build-scripts cmake cmake_uninstall.cmake.in configure configure.in debian docs include Makefile.* sdl2-config.cmake.in sdl2-config.in sdl2.m4 sdl2.pc.in SDL2.spec.in src test VisualC.html VisualC VisualC-WinRT Xcode Xcode-iOS
46 RUN_CMD_AR = @echo " AR " $@;
47 RUN_CMD_CC = @echo " CC " $@;
48 RUN_CMD_CXX = @echo " CXX " $@;
49 RUN_CMD_LTLINK = @echo " LTLINK" $@;
50 RUN_CMD_RANLIB = @echo " RANLIB" $@;
68 SDL_gamecontroller.h \
85 SDL_opengles2_gl2ext.h \
87 SDL_opengles2_gl2platform.h \
89 SDL_opengles2_khrplatform.h \
112 SDLTEST_HDRS = $(shell ls $(srcdir)/include | fgrep SDL_test)
115 LT_CURRENT = @LT_CURRENT@
116 LT_RELEASE = @LT_RELEASE@
117 LT_REVISION = @LT_REVISION@
118 LT_LDFLAGS = -no-undefined -rpath $(DESTDIR)$(libdir) -release $(LT_RELEASE) -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE)
120 all: $(srcdir)/configure Makefile $(objects) $(objects)/$(TARGET) $(objects)/$(SDLMAIN_TARGET) $(objects)/$(SDLTEST_TARGET)
122 $(srcdir)/configure: $(srcdir)/configure.in
123 @echo "Warning, configure.in is out of date"
124 #(cd $(srcdir) && sh autogen.sh && sh configure)
127 Makefile: $(srcdir)/Makefile.in
128 $(SHELL) config.status $@
133 $(SHELL) $(auxdir)/mkinstalldirs $@
136 $(SHELL) $(auxdir)/updaterev.sh
138 .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)
140 $(objects)/$(TARGET): $(OBJECTS) $(VERSION_OBJECTS)
141 $(RUN_CMD_LTLINK)$(LIBTOOL) --tag=CC --mode=link $(CC) -o $@ $(OBJECTS) $(VERSION_OBJECTS) $(LDFLAGS) $(EXTRA_LDFLAGS) $(LT_LDFLAGS)
143 $(objects)/$(SDLMAIN_TARGET): $(SDLMAIN_OBJECTS)
144 $(RUN_CMD_AR)$(AR) cru $@ $(SDLMAIN_OBJECTS)
145 $(RUN_CMD_RANLIB)$(RANLIB) $@
147 $(objects)/$(SDLTEST_TARGET): $(SDLTEST_OBJECTS)
148 $(RUN_CMD_AR)$(AR) cru $@ $(SDLTEST_OBJECTS)
149 $(RUN_CMD_RANLIB)$(RANLIB) $@
151 install: all install-bin install-hdrs install-lib install-data
153 $(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(bindir)
154 $(INSTALL) -m 755 sdl2-config $(DESTDIR)$(bindir)/sdl2-config
155 install-hdrs: update-revision
156 $(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(includedir)/SDL2
157 for file in $(HDRS) $(SDLTEST_HDRS); do \
158 $(INSTALL) -m 644 $(srcdir)/include/$$file $(DESTDIR)$(includedir)/SDL2/$$file; \
160 $(INSTALL) -m 644 include/SDL_config.h $(DESTDIR)$(includedir)/SDL2/SDL_config.h
161 if test -f include/SDL_revision.h; then \
162 $(INSTALL) -m 644 include/SDL_revision.h $(DESTDIR)$(includedir)/SDL2/SDL_revision.h; \
164 $(INSTALL) -m 644 $(srcdir)/include/SDL_revision.h $(DESTDIR)$(includedir)/SDL2/SDL_revision.h; \
167 install-lib: $(objects) $(objects)/$(TARGET) $(objects)/$(SDLMAIN_TARGET) $(objects)/$(SDLTEST_TARGET)
168 $(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(libdir)
169 $(LIBTOOL) --mode=install $(INSTALL) $(objects)/$(TARGET) $(DESTDIR)$(libdir)/$(TARGET)
170 $(INSTALL) -m 644 $(objects)/$(SDLMAIN_TARGET) $(DESTDIR)$(libdir)/$(SDLMAIN_TARGET)
171 $(RANLIB) $(DESTDIR)$(libdir)/$(SDLMAIN_TARGET)
172 $(INSTALL) -m 644 $(objects)/$(SDLTEST_TARGET) $(DESTDIR)$(libdir)/$(SDLTEST_TARGET)
173 $(RANLIB) $(DESTDIR)$(libdir)/$(SDLTEST_TARGET)
175 $(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(datadir)/aclocal
176 $(INSTALL) -m 644 $(srcdir)/sdl2.m4 $(DESTDIR)$(datadir)/aclocal/sdl2.m4
177 $(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(libdir)/pkgconfig
178 $(INSTALL) -m 644 sdl2.pc $(DESTDIR)$(libdir)/pkgconfig
179 $(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(libdir)/cmake/SDL2
180 $(INSTALL) -m 644 sdl2-config.cmake $(DESTDIR)$(libdir)/cmake/SDL2
182 uninstall: uninstall-bin uninstall-hdrs uninstall-lib uninstall-data
184 rm -f $(DESTDIR)$(bindir)/sdl2-config
186 for file in $(HDRS) $(SDLTEST_HDRS); do \
187 rm -f $(DESTDIR)$(includedir)/SDL2/$$file; \
189 rm -f $(DESTDIR)$(includedir)/SDL2/SDL_config.h
190 rm -f $(DESTDIR)$(includedir)/SDL2/SDL_revision.h
191 -rmdir $(DESTDIR)$(includedir)/SDL2
193 $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$(TARGET)
194 rm -f $(DESTDIR)$(libdir)/$(SDLMAIN_TARGET)
195 rm -f $(DESTDIR)$(libdir)/$(SDLTEST_TARGET)
197 rm -f $(DESTDIR)$(datadir)/aclocal/sdl2.m4
198 rm -f $(DESTDIR)$(libdir)/pkgconfig/sdl2.pc
199 rm -f $(DESTDIR)$(libdir)/cmake/SDL2/sdl2-config.cmake
203 if test -f test/Makefile; then (cd test; $(MAKE) $@); fi
206 rm -f Makefile Makefile.rules sdl2-config
207 rm -f config.status config.cache config.log libtool
208 rm -rf $(srcdir)/autom4te*
217 if test -f test/Makefile; then (cd test; $(MAKE) $@); fi
220 $(SHELL) $(auxdir)/mkinstalldirs $(distdir)
221 (cd $(srcdir); tar cf - $(SRC_DIST)) | (cd $(distdir); tar xf -)
222 tar cf - $(GEN_DIST) | (cd $(distdir); tar xf -)
231 if test -f $(distdir)/test/Makefile; then (cd $(distdir)/test && make distclean); fi
232 (cd $(distdir); build-scripts/updaterev.sh)
233 tar cvf - $(distdir) | gzip --best >$(distfile)