liboptcfg
diff Makefile @ 5:aca7267dfee0
fixed cross-compilation with mingw-w64
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Thu, 31 Aug 2017 05:59:19 +0300 |
parents | 8fd2858c6a29 |
children |
line diff
1.1 --- a/Makefile Wed Jul 27 05:05:45 2016 +0300 1.2 +++ b/Makefile Thu Aug 31 05:59:19 2017 +0300 1.3 @@ -11,12 +11,18 @@ 1.4 1.5 alib = lib$(name).a 1.6 1.7 +sodir = lib 1.8 + 1.9 CFLAGS = -pedantic -Wall -g 1.10 1.11 -sys := $(shell uname -s) 1.12 +sys := $(shell uname -s | sed 's/MINGW.*/mingw/') 1.13 ifeq ($(sys), Darwin) 1.14 solib = lib$(name).dylib 1.15 shared = -dynamiclib 1.16 +else ifeq ($(sys), mingw) 1.17 + solib = lib$(name).dll 1.18 + shared = -shared 1.19 + sodir = bin 1.20 else 1.21 ldname = lib$(name).so 1.22 soname = lib$(name).so.$(so_major) 1.23 @@ -40,11 +46,11 @@ 1.24 1.25 .PHONY: install 1.26 install: 1.27 - mkdir -p $(DESTDIR)$(PREFIX)/include $(DESTDIR)$(PREFIX)/lib 1.28 + mkdir -p $(DESTDIR)$(PREFIX)/bin $(DESTDIR)$(PREFIX)/include $(DESTDIR)$(PREFIX)/lib 1.29 cp src/optcfg.h $(DESTDIR)$(PREFIX)/include/optcfg.h 1.30 cp $(alib) $(DESTDIR)$(PREFIX)/lib/$(alib) 1.31 - cp $(solib) $(DESTDIR)$(PREFIX)/lib/$(solib) 1.32 - [ -n "$(soname)" ] && cd $(DESTDIR)$(PREFIX)/lib && \ 1.33 + cp $(solib) $(DESTDIR)$(PREFIX)/$(sodir)/$(solib) 1.34 + [ -n "$(soname)" ] && cd $(DESTDIR)$(PREFIX)/$(sodir) && \ 1.35 rm -f $(soname) $(ldname) && \ 1.36 ln -s $(solib) $(soname) && \ 1.37 ln -s $(soname) $(ldname) || true 1.38 @@ -53,7 +59,7 @@ 1.39 uninstall: 1.40 rm -f $(DESTDIR)$(PREFIX)/include/optcfg.h 1.41 rm -f $(DESTDIR)$(PREFIX)/lib/$(alib) 1.42 - rm -f $(DESTDIR)$(PREFIX)/lib/$(solib) 1.43 + rm -f $(DESTDIR)$(PREFIX)/$(sodir)/$(solib) 1.44 [ -n "$(soname)" ] && \ 1.45 - rm -f $(DESTDIR)$(PREFIX)/lib/$(soname) && \ 1.46 - rm -f $(DESTDIR)$(PREFIX)/lib/$(ldname) || true 1.47 + rm -f $(DESTDIR)$(PREFIX)/$(sodir)/$(soname) && \ 1.48 + rm -f $(DESTDIR)$(PREFIX)/$(sodir)/$(ldname) || true