File tree 2 files changed +15
-7
lines changed
2 files changed +15
-7
lines changed Original file line number Diff line number Diff line change @@ -6,18 +6,25 @@ MAKE := make
6
6
CFLAGS += -Wall -Wextra -fpic -O2 -fno-strict-aliasing -Wno-unused-parameter
7
7
8
8
SYS := $(shell gcc -dumpmachine)
9
- LIBFFI_PATH := ./libs/libffi/$(SYS )
10
- INCLUDES := -I$(LIBFFI_PATH ) /include
9
+ LIBFFI_PATH := ./libs/libffi
10
+
11
+ ifeq ($(SYS ) , x86_64-w64-mingw32)
12
+ BUILDSYS := $(SYS)
13
+ else
14
+ BUILDSYS := $(shell bash $(LIBFFI_PATH)/config.guess)
15
+ endif
16
+
17
+ LIBFFI_PATH := $(LIBFFI_PATH ) /$(BUILDSYS )
18
+ INCLUDES :=-I$(LIBFFI_PATH ) /include
11
19
LIBS := -L$(LIBFFI_PATH ) /.libs -lffi
12
20
13
21
ifneq (, $(findstring linux, $(SYS ) ) )
14
22
SUFFIX := so
15
23
LDFLAGS := -shared
16
24
LIBS += -ldl
17
25
else ifneq (, $(findstring mingw, $(SYS)))
18
- SUFFIX = dll
19
- LDFLAGS = -mdll
20
- CFLAGS += -I./libs/$(PLATFORM)/include/
26
+ SUFFIX := dll
27
+ LDFLAGS := -mdll
21
28
else
22
29
$(error Unsupported build platform)
23
30
endif
@@ -32,12 +39,12 @@ INCLUDES += -I${GLOBALS_HOME}/dev/cpp/include
32
39
CFLAGS += $(INCLUDES )
33
40
TESTSDIR := tests
34
41
35
- .PHONY : all clean libffi libffi_clean
42
+ .PHONY : all clean libffi libffi-clean
36
43
37
44
all : libcna.$(SUFFIX ) $(TESTSDIR ) /libtest.$(SUFFIX )
38
45
39
46
libffi :
40
- cd libs/libffi && ./configure --build=$(SYS ) --enable-shared=no && $(MAKE )
47
+ cd libs/libffi && ./configure --build=$(BUILDSYS ) --enable-shared=no && $(MAKE )
41
48
42
49
cna.o : cna.c storage.h
43
50
Original file line number Diff line number Diff line change 1
1
Makefile
2
2
config.log
3
+ confdefs.h
3
4
* ~
4
5
x86_64-w64-mingw32
You can’t perform that action at this time.
0 commit comments