[Workflow] Roll back some settings since they caused more issues
[llvm-project.git] / libc / AOR_v20.02 / Makefile
blob53e0245f82c40266c1e935af85860a04354c707b
1 # Makefile - 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 srcdir = .
8 prefix = /usr
9 bindir = $(prefix)/bin
10 libdir = $(prefix)/lib
11 includedir = $(prefix)/include
13 # Configure these in config.mk, do not make changes in this file.
14 SUBS = math string networking
15 HOST_CC = cc
16 HOST_CFLAGS = -std=c99 -O2
17 HOST_LDFLAGS =
18 HOST_LDLIBS =
19 EMULATOR =
20 CPPFLAGS =
21 CFLAGS = -std=c99 -O2
22 CFLAGS_SHARED = -fPIC
23 CFLAGS_ALL = -Ibuild/include $(CPPFLAGS) $(CFLAGS)
24 LDFLAGS =
25 LDLIBS =
26 AR = $(CROSS_COMPILE)ar
27 RANLIB = $(CROSS_COMPILE)ranlib
28 INSTALL = install
30 all:
32 -include config.mk
34 $(foreach sub,$(SUBS),$(eval include $(srcdir)/$(sub)/Dir.mk))
36 # Required targets of subproject foo:
37 # all-foo
38 # check-foo
39 # clean-foo
40 # install-foo
41 # Required make variables of subproject foo:
42 # foo-files: Built files (all in build/).
43 # Make variables used by subproject foo:
44 # foo-...: Variables defined in foo/Dir.mk or by config.mk.
46 all: $(SUBS:%=all-%)
48 ALL_FILES = $(foreach sub,$(SUBS),$($(sub)-files))
49 DIRS = $(sort $(patsubst %/,%,$(dir $(ALL_FILES))))
50 $(ALL_FILES): | $(DIRS)
51 $(DIRS):
52 mkdir -p $@
54 $(filter %.os,$(ALL_FILES)): CFLAGS_ALL += $(CFLAGS_SHARED)
56 build/%.o: $(srcdir)/%.S
57 $(CC) $(CFLAGS_ALL) -c -o $@ $<
59 build/%.o: $(srcdir)/%.c
60 $(CC) $(CFLAGS_ALL) -c -o $@ $<
62 build/%.os: $(srcdir)/%.S
63 $(CC) $(CFLAGS_ALL) -c -o $@ $<
65 build/%.os: $(srcdir)/%.c
66 $(CC) $(CFLAGS_ALL) -c -o $@ $<
68 clean: $(SUBS:%=clean-%)
69 rm -rf build
71 distclean: clean
72 rm -f config.mk
74 $(DESTDIR)$(bindir)/%: build/bin/%
75 $(INSTALL) -D $< $@
77 $(DESTDIR)$(libdir)/%.so: build/lib/%.so
78 $(INSTALL) -D $< $@
80 $(DESTDIR)$(libdir)/%: build/lib/%
81 $(INSTALL) -m 644 -D $< $@
83 $(DESTDIR)$(includedir)/%: build/include/%
84 $(INSTALL) -m 644 -D $< $@
86 install: $(SUBS:%=install-%)
88 check: $(SUBS:%=check-%)
90 .PHONY: all clean distclean install check