File tree Expand file tree Collapse file tree 4 files changed +30
-3
lines changed Expand file tree Collapse file tree 4 files changed +30
-3
lines changed Original file line number Diff line number Diff line change @@ -53,6 +53,7 @@ dkms.conf
5353
5454# custom
5555bin /
56+ tmp /
5657gen_asm.s
5758
5859# Visual Studio noise
@@ -64,4 +65,7 @@ gen_asm.s
6465
6566# Allow our release libraries
6667! lib /** /* .lib
67- ! lib /** /* .a
68+ ! lib /** /* .a
69+
70+ # vs code
71+ .vscode /
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ CFLAGS += $(NO_CET)
1111CXXFLAGS += $(NO_CET )
1212
1313# run c preprocessor with any cflags to get cross compilation result, then run regular compile in native
14- ABI := $(shell mkdir -p bin; $(CC ) -E $(CFLAGS ) $( CPPFLAGS ) -o bin/get_abi.c get_abi.c && $( CC ) -o bin/get_abi bin/get_abi.c && bin/get_abi )
14+ ABI := $(shell ./abiname.sh " $(CC ) " " $(CFLAGS ) " )
1515ifndef ABI
1616$(error Could not determine platform)
1717else
3434
3535clean :
3636 rm -f src/* .o tests/* .o
37- rm -f bin/*
37+ rm -f bin/* tmp
3838
3939DEBUG = # -DDEBUG_DUMP
4040
Original file line number Diff line number Diff line change 1+ #! /bin/sh
2+
3+ # this script compiles and runs src/abiname.c which merely prints
4+ # out the name of the abi. This can be used by makefiles to identify
5+ # the correct library path to use to link the library
6+ # Instead of just compiling and running, we will use the provided compiler
7+ # and flags to just invoke the pre-processor. We then use the default
8+ # compiler and linker to compile and link it. This ensures that the
9+ # script works in cross-compilation environments and can actually
10+ # run the provided code.
11+ set -eu
12+ here=$( dirname " $0 " )
13+ mkdir -p " ${here} /tmp"
14+ tmp=$( mktemp " ${here} /tmp/abinameXXX.c" )
15+
16+ # 1 create the preprocessed file
17+ CC=${1:- cc}
18+ CFLAGS=${2:- }
19+ ${CC} ${CFLAGS} -E -I " ${here} /src" -o " ${tmp} " " ${here} /src/abiname.c"
20+ # 2 compile resulting file
21+ cc -o " ${tmp} .out" " ${tmp} "
22+ # 3 run it
23+ " ${tmp} .out"
File renamed without changes.
You can’t perform that action at this time.
0 commit comments