spack/var/spack/repos/builtin/packages/dsfmt/targets.patch

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

26 lines
578 B
Diff
Raw Normal View History

2021-11-15 18:15:42 +08:00
diff --git a/Makefile b/Makefile
index 5cc4ed6..adc09c5 100644
2021-11-15 18:15:42 +08:00
--- a/Makefile
+++ b/Makefile
@@ -196,3 +196,20 @@ test-sse2-M216091: test.c dSFMT.c dSFMT.h
2021-11-15 18:15:42 +08:00
clean:
rm -f *.o *~ test-*-M*
+
+ifeq ($(OS), WINNT)
+ SHLIB_EXT := dll
+else ifeq ($(OS), Darwin)
+ SHLIB_EXT := dylib
+else
+ SHLIB_EXT := so
+endif
2021-11-15 18:15:42 +08:00
+
+build-library: dSFMT.c
+ $(CC) $(CCFLAGS) -shared -fPIC -DDSFMT_MEXP=19937 -DDSFMT_DO_NOT_USE_OLD_NAMES -DDSFMT_SHLIB $< -o libdSFMT.$(SHLIB_EXT)
+ echo 1 > $@
+
+install: build-library
2021-11-15 18:15:42 +08:00
+ install -d $(PREFIX)/lib/
+ install -m 644 libdSFMT.so $(PREFIX)/lib/
+