From aa1727ae42b0f7ebf29c9797cefb94bc46365167 Mon Sep 17 00:00:00 2001 From: Raghu Rajagopalan Date: Sun, 7 Oct 2018 08:16:41 +0530 Subject: [PATCH] Makefile - works on windows + msys2 --- Makefile | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 42be444..350c38e 100644 --- a/Makefile +++ b/Makefile @@ -1,18 +1,24 @@ .DEFAULT_GOAL := all +ifdef WINDIR + extn=pyd +else + extn=so +endif src = rplugin/python3 relopt = -d:release -d:removelogger infoopt = -d:release native = FUZZY_CMOD=1 win = --os:windows --cpu:amd64 --gcc.exe:/usr/bin/x86_64-w64-mingw32-gcc --gcc.linkerexe:/usr/bin/x86_64-w64-mingw32-gcc +binary=fruzzy_mod.$(extn) build-debug: cd $(src) && \ - nim c --app:lib --out:fruzzy_mod.so $(infoopt) fruzzy_mod + nim c --app:lib --out:$(binary) $(infoopt) fruzzy_mod build: cd $(src) && \ - nim c --app:lib --out:fruzzy_mod.so $(relopt) fruzzy_mod + nim c --app:lib --out:$(binary) $(relopt) fruzzy_mod debug-single: build-debug @echo Testing native mod with minimal file @@ -39,8 +45,11 @@ test-native: build test: test-py test-native win: +ifndef WINDIR cd $(src) && \ nim c --app:lib $(win) --out:fruzzy_mod.pyd $(relopt) fruzzy_mod +endif + all: test build rel: win build ls -al $(src)/fruzzy_mod*