aboutsummaryrefslogtreecommitdiffhomepage
path: root/Makefile
diff options
context:
space:
mode:
authorbakpakin <calsrose@gmail.com>2023-01-21 14:31:48 -0600
committerbakpakin <calsrose@gmail.com>2023-01-21 14:31:48 -0600
commit2f8bed9d824d082a7ff227c68a715a2343aca6d6 (patch)
tree5cb16a448eb08d590ebbd8e3820d9367082e486a /Makefile
parentAdd :mingw value when getting the OS setting when compiled with mingw. (diff)
Build and install an import library on mingw
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile4
1 files changed, 3 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index ebc5eaf0..a108525d 100644
--- a/Makefile
+++ b/Makefile
@@ -31,6 +31,7 @@ LIBDIR?=$(PREFIX)/lib
JANET_BUILD?="\"$(shell git log --pretty=format:'%h' -n 1 2> /dev/null || echo local)\""
CLIBS=-lm -lpthread
JANET_TARGET=build/janet
+JANET_IMPORT_LIB=build/janet.lib
JANET_LIBRARY=build/libjanet.so
JANET_STATIC_LIBRARY=build/libjanet.a
JANET_PATH?=$(LIBDIR)/janet
@@ -80,7 +81,7 @@ endif
# Mingw
ifeq ($(findstring MINGW,$(UNAME)), MINGW)
CLIBS:=-lws2_32 -lpsapi -lwsock32
- LDFLAGS:=
+ LDFLAGS:=-Wl,--out-implib,$(JANET_IMPORT_LIB)
endif
$(shell mkdir -p build/core build/c build/boot)
@@ -307,6 +308,7 @@ install: $(JANET_TARGET) $(JANET_LIBRARY) $(JANET_STATIC_LIBRARY) build/janet.pc
cp janet.1 '$(DESTDIR)$(JANET_MANPATH)'
mkdir -p '$(DESTDIR)$(JANET_PKG_CONFIG_PATH)'
cp build/janet.pc '$(DESTDIR)$(JANET_PKG_CONFIG_PATH)/janet.pc'
+ cp '$(JANET_IMPORT_LIB)' '$(DESTDIR)$(LIBDIR)' || echo 'no import lib to install (mingw only)'
[ -z '$(DESTDIR)' ] && $(LDCONFIG) || echo "You can ignore this error for non-Linux systems or local installs"
install-jpm-git: $(JANET_TARGET)