[NFC][Py Reformat] Added more commits to .git-blame-ignore-revs
[llvm-project.git] / libc / AOR_v20.02 / networking / Dir.mk
blob68bc94b41e3d6dba32b5484cea3a5f43a287df09
1 # Makefile fragment - requires GNU make
3 # Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 # See https://llvm.org/LICENSE.txt for license information.
5 # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 S := $(srcdir)/networking
8 B := build/networking
10 ifeq ($(ARCH),)
11 all-networking check-networking install-networking clean-networking:
12 @echo "*** Please set ARCH in config.mk. ***"
13 @exit 1
14 else
16 networking-lib-srcs := $(wildcard $(S)/*.[cS]) $(wildcard $(S)/$(ARCH)/*.[cS])
17 networking-test-srcs := $(wildcard $(S)/test/*.c)
19 networking-includes := $(patsubst $(S)/%,build/%,$(wildcard $(S)/include/*.h))
21 networking-libs := \
22 build/lib/libnetworking.so \
23 build/lib/libnetworking.a \
25 networking-tools := \
26 build/bin/test/chksum
28 networking-lib-objs := $(patsubst $(S)/%,$(B)/%.o,$(basename $(networking-lib-srcs)))
29 networking-test-objs := $(patsubst $(S)/%,$(B)/%.o,$(basename $(networking-test-srcs)))
31 networking-objs := \
32 $(networking-lib-objs) \
33 $(networking-lib-objs:%.o=%.os) \
34 $(networking-test-objs) \
36 networking-files := \
37 $(networking-objs) \
38 $(networking-libs) \
39 $(networking-tools) \
40 $(networking-includes) \
42 all-networking: $(networking-libs) $(networking-tools) $(networking-includes)
44 $(networking-objs): $(networking-includes)
45 $(networking-objs): CFLAGS_ALL += $(networking-cflags)
47 build/lib/libnetworking.so: $(networking-lib-objs:%.o=%.os)
48 $(CC) $(CFLAGS_ALL) $(LDFLAGS) -shared -o $@ $^
50 build/lib/libnetworkinglib.a: $(networking-lib-objs)
51 rm -f $@
52 $(AR) rc $@ $^
53 $(RANLIB) $@
55 build/bin/test/%: $(B)/test/%.o build/lib/libnetworkinglib.a
56 $(CC) $(CFLAGS_ALL) $(LDFLAGS) -static -o $@ $^ $(LDLIBS)
58 build/include/%.h: $(S)/include/%.h
59 cp $< $@
61 build/bin/%.sh: $(S)/test/%.sh
62 cp $< $@
64 check-networking: $(networking-tools)
65 $(EMULATOR) build/bin/test/chksum -i simple
66 $(EMULATOR) build/bin/test/chksum -i scalar
67 $(EMULATOR) build/bin/test/chksum -i simd || true # simd is not always available
69 install-networking: \
70 $(networking-libs:build/lib/%=$(DESTDIR)$(libdir)/%) \
71 $(networking-includes:build/include/%=$(DESTDIR)$(includedir)/%)
73 clean-networking:
74 rm -f $(networking-files)
75 endif
77 .PHONY: all-networking check-networking install-networking clean-networking