Makefile 1.1 KB

12345678910111213141516171819202122232425262728293031
  1. #
  2. # Makefile for installing the mingw32 version of the SDL library
  3. CROSS_PATH := /usr/local
  4. ARCHITECTURES := i686-w64-mingw32 x86_64-w64-mingw32
  5. all install:
  6. @echo "Type \"make native\" to install 32-bit to /usr"
  7. @echo "Type \"make cross\" to install 32-bit and 64-bit to $(CROSS_PATH)"
  8. native:
  9. make install-package arch=i686-w64-mingw32 prefix=/usr
  10. cross:
  11. for arch in $(ARCHITECTURES); do \
  12. make install-package arch=$$arch prefix=$(CROSS_PATH)/$$arch; \
  13. done
  14. install-package:
  15. @if test -d $(arch) && test -d $(prefix); then \
  16. (cd $(arch) && cp -rv bin include lib share $(prefix)/); \
  17. sed "s|^prefix=.*|prefix=$(prefix)|" <$(arch)/bin/sdl2-config >$(prefix)/bin/sdl2-config; \
  18. chmod 755 $(prefix)/bin/sdl2-config; \
  19. sed "s|^libdir=.*|libdir=\'$(prefix)/lib\'|" <$(arch)/lib/libSDL2.la >$(prefix)/lib/libSDL2.la; \
  20. sed "s|^libdir=.*|libdir=\'$(prefix)/lib\'|" <$(arch)/lib/libSDL2main.la >$(prefix)/lib/libSDL2main.la; \
  21. sed "s|^prefix=.*|prefix=$(prefix)|" <$(arch)/lib/pkgconfig/sdl2.pc >$(prefix)/lib/pkgconfig/sdl2.pc; \
  22. else \
  23. echo "*** ERROR: $(arch) or $(prefix) does not exist!"; \
  24. exit 1; \
  25. fi