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