|
1 | | -TARGET = $(subst 64,x86_64,$(subst 32,i686,$(WIN)))-pc-windows-gnu |
2 | | -LIBDIR = myrustlib/target/$(TARGET)/release |
3 | | -STATLIB = $(LIBDIR)/libmyrustlib.a |
4 | | -PKG_LIBS = -L$(LIBDIR) -lmyrustlib -lws2_32 -ladvapi32 -luserenv -ldbghelp -lbcrypt |
| 1 | +VERSION = 1.12.0 |
| 2 | +RWINLIB = ../windows/gifski-winlibs |
| 3 | +PKG_CPPFLAGS = -I$(RWINLIB)/include |
| 4 | +GCC_VERSION = ${subst gcc,,${COMPILED_BY}} |
| 5 | +PKG_LIBS = -L$(RWINLIB)/lib$(GCC_VERSION)$(R_ARCH) \ |
| 6 | + -L$(RWINLIB)/lib$(R_ARCH) \ |
| 7 | + -lgifski -lws2_32 -ladvapi32 -luserenv -ldbghelp -lbcrypt |
5 | 8 |
|
6 | | -# These can also be set in ~/.cargo/config |
7 | | -ifeq ($(R_COMPILED_BY),gcc 8.3.0) |
8 | | -GCCPATH=$(subst C:\,/c/,$(RTOOLS40_HOME))/mingw$(WIN)/bin |
9 | | -export CARGO_TARGET_X86_64_PC_WINDOWS_GNU_LINKER=$(RTOOLS40_HOME)\\mingw64\\bin\\gcc |
10 | | -export CARGO_TARGET_I686_PC_WINDOWS_GNU_LINKER=$(RTOOLS40_HOME)\\\mingw32\\bin\\gcc |
11 | | -else |
12 | | -GCCPATH=$(subst C:\,/c/,$(RTOOLS43_HOME))/x86_64-w64-mingw32.static.posix/bin |
13 | | -endif |
| 9 | +all: clean winlibs |
14 | 10 |
|
15 | | -all: clean rustup |
16 | | - |
17 | | -$(SHLIB): $(STATLIB) |
18 | | - |
19 | | -$(STATLIB): |
20 | | -ifeq ($(WIN),64) #hack for mxe-rtools42 missing -lgcc_eh |
21 | | - mkdir -p myrustlib/target/release/deps; echo '!<arch>' > myrustlib/target/release/deps/libgcc_eh.a |
22 | | -endif |
23 | | - PATH="$(GCCPATH):$(USERPROFILE)\.cargo:$(PATH)" cargo build --target=$(TARGET) --release --manifest-path=myrustlib/Cargo.toml |
24 | | - rm -Rf $(LIBDIR)/build |
| 11 | +winlibs: |
| 12 | + "${R_HOME}/bin${R_ARCH_BIN}/Rscript.exe" "../tools/winlibs.R" $(VERSION) |
25 | 13 |
|
26 | 14 | clean: |
27 | | - rm -Rf $(SHLIB) $(STATLIB) $(OBJECTS) myrustlib/target |
28 | | - |
29 | | -rustup: |
30 | | - rustup target add $(TARGET) || true |
| 15 | + rm -f $(SHLIB) $(OBJECTS) |
0 commit comments