Skip to content

Commit 1027756

Browse files
committed
pl/math: Cleanup Dir.mk
Rename some make variables to avoid clashes when building math and pl/math.
1 parent bc2c14a commit 1027756

File tree

1 file changed

+26
-26
lines changed

1 file changed

+26
-26
lines changed

pl/math/Dir.mk

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
# Makefile fragment - requires GNU make
22
#
3-
# Copyright (c) 2019-2023, Arm Limited.
3+
# Copyright (c) 2019-2024, Arm Limited.
44
# SPDX-License-Identifier: MIT OR Apache-2.0 WITH LLVM-exception
55

66
PLM := $(srcdir)/pl/math
77
AOR := $(srcdir)/math
88
B := build/pl/math
99

10-
math-lib-srcs := $(wildcard $(PLM)/*.[cS])
10+
pl-lib-srcs := $(wildcard $(PLM)/*.[cS])
1111

1212
ifeq ($(WANT_SVE_MATH), 0)
13-
math-lib-srcs := $(filter-out $(PLM)/sv_%, $(math-lib-srcs))
13+
pl-lib-srcs := $(filter-out $(PLM)/sv_%, $(pl-lib-srcs))
1414
endif
1515

1616
math-test-srcs := \
@@ -20,10 +20,10 @@ math-test-srcs := \
2020

2121
math-test-host-srcs := $(wildcard $(AOR)/test/rtest/*.[cS])
2222

23-
math-includes := $(patsubst $(PLM)/%,build/pl/%,$(wildcard $(PLM)/include/*.h))
24-
math-test-includes := $(patsubst $(PLM)/%,build/pl/include/%,$(wildcard $(PLM)/test/*.h))
23+
pl-includes := $(patsubst $(PLM)/%,build/pl/%,$(wildcard $(PLM)/include/*.h))
24+
pl-test-includes := $(patsubst $(PLM)/%,build/pl/include/%,$(wildcard $(PLM)/test/*.h))
2525

26-
math-libs := \
26+
pl-libs := \
2727
build/pl/lib/libmathlib.so \
2828
build/pl/lib/libmathlib.a \
2929

@@ -37,39 +37,39 @@ math-tools := \
3737
math-host-tools := \
3838
build/pl/bin/rtest \
3939

40-
math-lib-objs := $(patsubst $(PLM)/%,$(B)/%.o,$(basename $(math-lib-srcs)))
40+
pl-lib-objs := $(patsubst $(PLM)/%,$(B)/%.o,$(basename $(pl-lib-srcs)))
4141
math-test-objs := $(patsubst $(AOR)/%,$(B)/%.o,$(basename $(math-test-srcs)))
4242
math-host-objs := $(patsubst $(AOR)/%,$(B)/%.o,$(basename $(math-test-host-srcs)))
43-
math-target-objs := $(math-lib-objs) $(math-test-objs)
44-
math-objs := $(math-target-objs) $(math-target-objs:%.o=%.os) $(math-host-objs)
43+
pl-target-objs := $(pl-lib-objs) $(math-test-objs)
44+
pl-objs := $(pl-target-objs) $(pl-target-objs:%.o=%.os) $(math-host-objs)
4545

4646
pl/math-files := \
47-
$(math-objs) \
48-
$(math-libs) \
47+
$(pl-objs) \
48+
$(pl-libs) \
4949
$(math-tools) \
5050
$(math-host-tools) \
51-
$(math-includes) \
52-
$(math-test-includes) \
51+
$(pl-includes) \
52+
$(pl-test-includes) \
5353

54-
all-pl/math: $(math-libs) $(math-tools) $(math-includes) $(math-test-includes)
54+
all-pl/math: $(pl-libs) $(math-tools) $(pl-includes) $(pl-test-includes)
5555

56-
$(math-objs): $(math-includes) $(math-test-includes)
57-
$(math-objs): CFLAGS_PL += $(math-cflags)
56+
$(pl-objs): $(pl-includes) $(pl-test-includes)
57+
$(pl-objs): CFLAGS_PL += $(math-cflags)
5858
$(B)/test/mathtest.o: CFLAGS_PL += -fmath-errno
5959
$(math-host-objs): CC = $(HOST_CC)
6060
$(math-host-objs): CFLAGS_PL = $(HOST_CFLAGS)
6161

6262
$(B)/sv_%: CFLAGS_PL += $(math-sve-cflags)
6363

64-
build/pl/include/test/ulp_funcs_gen.h: $(math-lib-srcs)
64+
build/pl/include/test/ulp_funcs_gen.h: $(pl-lib-srcs)
6565
# Replace PL_SIG
6666
cat $^ | grep PL_SIG | $(CC) -xc - -o - -E "-DPL_SIG(v, t, a, f, ...)=_Z##v##t##a(f)" -P > $@
6767

68-
build/pl/include/test/mathbench_funcs_gen.h: $(math-lib-srcs)
68+
build/pl/include/test/mathbench_funcs_gen.h: $(pl-lib-srcs)
6969
# Replace PL_SIG macros with mathbench func entries
7070
cat $^ | grep PL_SIG | $(CC) -xc - -o - -E "-DPL_SIG(v, t, a, f, ...)=_Z##v##t##a(f, ##__VA_ARGS__)" -P > $@
7171

72-
build/pl/include/test/ulp_wrappers_gen.h: $(math-lib-srcs)
72+
build/pl/include/test/ulp_wrappers_gen.h: $(pl-lib-srcs)
7373
# Replace PL_SIG macros with ULP wrapper declarations
7474
cat $^ | grep PL_SIG | $(CC) -xc - -o - -E "-DPL_SIG(v, t, a, f, ...)=Z##v##N##t##a##_WRAP(f)" -P > $@
7575

@@ -79,10 +79,10 @@ $(B)/test/ulp.o: CFLAGS_PL += -I build/pl/include/test
7979
$(B)/test/mathbench.o: build/pl/include/test/mathbench_funcs_gen.h
8080
$(B)/test/mathbench.o: CFLAGS_PL += -I build/pl/include/test
8181

82-
build/pl/lib/libmathlib.so: $(math-lib-objs:%.o=%.os)
82+
build/pl/lib/libmathlib.so: $(pl-lib-objs:%.o=%.os)
8383
$(CC) $(CFLAGS_PL) $(LDFLAGS) -shared -o $@ $^
8484

85-
build/pl/lib/libmathlib.a: $(math-lib-objs)
85+
build/pl/lib/libmathlib.a: $(pl-lib-objs)
8686
rm -f $@
8787
$(AR) rc $@ $^
8888
$(RANLIB) $@
@@ -154,9 +154,9 @@ check-pl/math-rtest: $(math-host-tools) $(math-tools)
154154

155155
ulp-input-dir=$(B)/test/inputs
156156

157-
math-lib-lims = $(patsubst $(PLM)/%,$(ulp-input-dir)/%.ulp,$(basename $(math-lib-srcs)))
158-
math-lib-fenvs = $(patsubst $(PLM)/%,$(ulp-input-dir)/%.fenv,$(basename $(math-lib-srcs)))
159-
math-lib-itvs = $(patsubst $(PLM)/%,$(ulp-input-dir)/%.itv,$(basename $(math-lib-srcs)))
157+
math-lib-lims = $(patsubst $(PLM)/%,$(ulp-input-dir)/%.ulp,$(basename $(pl-lib-srcs)))
158+
math-lib-fenvs = $(patsubst $(PLM)/%,$(ulp-input-dir)/%.fenv,$(basename $(pl-lib-srcs)))
159+
math-lib-itvs = $(patsubst $(PLM)/%,$(ulp-input-dir)/%.itv,$(basename $(pl-lib-srcs)))
160160

161161
ulp-inputs = $(math-lib-lims) $(math-lib-fenvs) $(math-lib-itvs)
162162

@@ -207,8 +207,8 @@ $(DESTDIR)$(includedir)/pl/%: build/pl/include/%
207207
$(INSTALL) -m 644 -D $< $@
208208

209209
install-pl/math: \
210-
$(math-libs:build/pl/lib/%=$(DESTDIR)$(libdir)/pl/%) \
211-
$(math-includes:build/pl/include/%=$(DESTDIR)$(includedir)/pl/%)
210+
$(pl-libs:build/pl/lib/%=$(DESTDIR)$(libdir)/pl/%) \
211+
$(pl-includes:build/pl/include/%=$(DESTDIR)$(includedir)/pl/%)
212212

213213
clean-pl/math:
214214
rm -f $(pl/math-files)

0 commit comments

Comments
 (0)