Skip to content

Commit 6521001

Browse files
committed
respect $bindir
1 parent af26ae1 commit 6521001

File tree

1 file changed

+24
-22
lines changed

1 file changed

+24
-22
lines changed

tests/host/Makefile

Lines changed: 24 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -51,28 +51,6 @@ endif
5151
OUTPUT_BINARY := $(BINDIR)/host_tests
5252
LCOV_DIRECTORY := $(BINDIR)/../lcov
5353

54-
# Core files sometimes override libc functions, check when necessary to hide them
55-
# TODO proper configure script / other build system?
56-
ifeq (,$(wildcard ./.have_strlcpy))
57-
$(shell echo -e '#include <cstring>\nint main(){char a[4]; char b[4]; strlcpy(&a[0], &b[0], sizeof(a)); return 0;}' | \
58-
$(CXX) -x c++ - -o .have_strlcpy 2>/dev/null || { echo -e '#!/bin/sh\nexit 1' > .have_strlcpy ; chmod +x .have_strlcpy; })
59-
endif
60-
61-
$(shell ./.have_strlcpy)
62-
ifeq ($(.SHELLSTATUS), 0)
63-
FLAGS += -DHAVE_STRLCPY
64-
endif
65-
66-
ifeq (,$(wildcard ./.have_strlcat))
67-
$(shell echo -e '#include <cstring>\nint main(){char a[4]; strlcat(&a[0], "test", sizeof(a)); return 0;}' | \
68-
$(CXX) -x c++ - -o .have_strlcat 2>/dev/null || { echo -e '#!/bin/sh\nexit 1' > .have_strlcat ; chmod +x .have_strlcat; })
69-
endif
70-
71-
$(shell ./.have_strlcat)
72-
ifeq ($(.SHELLSTATUS), 0)
73-
FLAGS += -DHAVE_STRLCAT
74-
endif
75-
7654
# Hide full build commands by default
7755
ifeq ($(V), 0)
7856
VERBC = @echo "C $@";
@@ -90,6 +68,30 @@ endif
9068

9169
$(shell mkdir -p $(BINDIR))
9270

71+
# Core files sometimes override libc functions, check when necessary to hide them
72+
# TODO proper configure script / other build system?
73+
ifeq (,$(wildcard $(BINDIR)/.have_strlcpy))
74+
$(shell echo -e '#include <cstring>\nint main(){char a[4]; char b[4]; strlcpy(&a[0], &b[0], sizeof(a)); return 0;}' | \
75+
$(CXX) -x c++ - -o $(BINDIR)/.have_strlcpy 2>/dev/null || { echo -e '#!/bin/sh\nexit 1' > $(BINDIR)/.have_strlcpy ; chmod +x $(BINDIR)/.have_strlcpy; })
76+
endif
77+
78+
$(shell $(BINDIR)/.have_strlcpy)
79+
ifeq ($(.SHELLSTATUS), 0)
80+
FLAGS += -DHAVE_STRLCPY
81+
endif
82+
83+
ifeq (,$(wildcard $(BINDIR)/.have_strlcat))
84+
$(shell echo -e '#include <cstring>\nint main(){char a[4]; strlcat(&a[0], "test", sizeof(a)); return 0;}' | \
85+
$(CXX) -x c++ - -o $(BINDIR)/.have_strlcat 2>/dev/null || { echo -e '#!/bin/sh\nexit 1' > $(BINDIR)/.have_strlcat ; chmod +x $(BINDIR)/.have_strlcat; })
86+
endif
87+
88+
$(shell $(BINDIR)/.have_strlcat)
89+
ifeq ($(.SHELLSTATUS), 0)
90+
FLAGS += -DHAVE_STRLCAT
91+
endif
92+
93+
# Actual build recipes
94+
9395
CORE_CPP_FILES := \
9496
$(addprefix $(abspath $(CORE_PATH))/,\
9597
debug.cpp \

0 commit comments

Comments
 (0)