Skip to content

Commit a75cc6d

Browse files
committed
test/Makefile: use CXX, instead of CC/LD for crosc compile
1 parent 02c2b79 commit a75cc6d

File tree

4 files changed

+12
-20
lines changed

4 files changed

+12
-20
lines changed

test/Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
GCC_MACHINE=$(shell gcc -dumpmachine)
1+
GCC_MACHINE=$(shell $(CXX) -dumpmachine)
22
$(info "-- GCC_MACHINE = ${GCC_MACHINE}")
33
OS=$(shell uname -s | sed 's/[^A-Za-z1-9].*//')
44
$(info "-- OS = ${OS}")
@@ -25,11 +25,11 @@ OBJ=$(basename $(SRC)).o
2525
LIB=$(basename $(SRC)).$(LSFX)
2626

2727
$(LIB): $(OBJ)
28-
$(LD) $(SOFLAGS) $(OUTOPT)$(LIB) $(OBJ) $(LDFLAGS)
28+
$(CXX) $(SOFLAGS) $(OUTOPT)$(LIB) $(OBJ) $(LDFLAGS)
2929
@echo "Try make test"
3030

3131
$(OBJ): $(SRC)
32-
$(CC) $(CFLAGS) -DCOMPILE_LIB -c $(SRC) $(OBJOPT)$(OBJ)
32+
$(CXX) $(CFLAGS) -DCOMPILE_LIB -c $(SRC) $(OBJOPT)$(OBJ)
3333

3434
clean:
3535
rm -f $(LIB) $(OBJ)

test/Makefile.Cygwin

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
1-
CC = c++
1+
CXX ?= c++
22
CFLAGS = -O2 -falign-functions=4 -DCygwin -I$(EUSDIR)/include
33
LDFLAGS =
44
OBJOPT = -o
55
OUTOPT = -o
6-
LD = c++ -shared -falign-functions=4
7-
EXELD = c++ -falign-functions=4
8-
SOFLAGS =
6+
SOFLAGS = -shared -falign-functions=4
97
EXESFX = .exe
108
LSFX = dll
119
LPFX = lib

test/Makefile.Darwin

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
1-
CC = c++
1+
CXX ?= c++
22
CFLAGS = -O2 -falign-functions=8 -fPIC -DDarwin -DGCC -I$(EUSDIR)/include
33
LDFLAGS =
44
OBJOPT = -o
55
OUTOPT = -o
6-
LD = c++
76
SOFLAGS = -dynamiclib -flat_namespace -undefined suppress
8-
EXELD = c++
97
EXESFX =
108
LSFX = so
119
LPFX = lib

test/Makefile.Linux

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,29 @@
1-
CC = c++
1+
CXX ?= c++
22
CFLAGS = -O2 -DLinux -DGCC -I$(EUSDIR)/include
33
LDFLAGS =
44
OBJOPT = -o
55
OUTOPT = -o
6-
LD = c++
76
SOFLAGS = -shared
8-
EXELD = c++
97
EXESFX =
108
LSFX = so
119
LPFX = lib
1210

13-
ifneq (,$(findstring 64,$(shell gcc -dumpmachine)))
11+
ifneq (,$(findstring 64,$(shell $(CXX) -dumpmachine)))
1412
CFLAGS+=-falign-functions=8
1513
else
1614
CFLAGS+=-falign-functions=4
1715
endif
1816

19-
ifneq ($(shell gcc -dumpmachine | egrep "^(arm|aarch)"),)
17+
ifneq ($(shell $(CXX) -dumpmachine | egrep "^(arm|aarch)"),)
2018
LDFLAGS+=-Wl,-z,execstack
2119
CFLAGS+=-DARM -fPIC
2220
endif
23-
ifneq ($(shell gcc -dumpmachine | grep "^x86_64"),)
21+
ifneq ($(shell $(CXX) -dumpmachine | grep "^x86_64"),)
2422
CFLAGS+=-fPIC
2523
endif
2624

27-
ifneq ($(shell gcc -dumpmachine | grep "i.*86-linux"),)
28-
CC += -m32
29-
LD += -m32
30-
EXELD += -m32
25+
ifneq ($(shell $(CXX) -dumpmachine | grep "i.*86-linux"),)
26+
CXX += -m32
3127
endif
3228

3329

0 commit comments

Comments
 (0)