Rev 4341 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 4341 | Rev 4342 | ||
---|---|---|---|
Line 25... | Line 25... | ||
25 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
25 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
26 | # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
27 | # |
27 | # |
28 | 28 | ||
29 | include ../../../../version |
29 | include ../../../../version |
30 | -include ../../../../Makefile.config |
- | |
31 | 30 | ||
32 | ## Setup toolchain |
31 | ## Setup toolchain |
33 | # |
32 | # |
34 | 33 | ||
35 | LIBC_PREFIX = ../../../lib/libc |
34 | LIBC_PREFIX = ../../../lib/libc |
36 | APP_LIBC_PREFIX = ../../lib/libc |
35 | APP_LIBC_PREFIX = ../../lib/libc |
37 | SOFTINT_PREFIX = ../../../lib/softint |
36 | SOFTINT_PREFIX = ../../../lib/softint |
38 | RTLD_PREFIX = ../../../lib/rtld |
37 | RTLD_PREFIX = ../../../lib/rtld |
39 | include $(LIBC_PREFIX)/Makefile.toolchain |
38 | include $(LIBC_PREFIX)/Makefile.toolchain |
40 | #include arch/$(ARCH)/Makefile.inc |
39 | #include arch/$(UARCH)/Makefile.inc |
41 | ARCH_SOURCES := |
40 | ARCH_SOURCES := |
42 | 41 | ||
43 | LFLAGS = -shared -soname libc.so.0 --whole-archive |
42 | LFLAGS = -shared -soname libc.so.0 --whole-archive |
44 | 43 | ||
45 | LIBS = \ |
44 | LIBS = \ |
Line 47... | Line 46... | ||
47 | $(SOFTINT_PREFIX)/libsoftint.pic.a \ |
46 | $(SOFTINT_PREFIX)/libsoftint.pic.a \ |
48 | $(RTLD_PREFIX)/librtld.pic.a |
47 | $(RTLD_PREFIX)/librtld.pic.a |
49 | 48 | ||
50 | DEFS += -DRELEASE=\"$(RELEASE)\" |
49 | DEFS += -DRELEASE=\"$(RELEASE)\" |
51 | 50 | ||
52 | ifdef REVISION |
- | |
53 | DEFS += "-DREVISION=\"$(REVISION)\"" |
- | |
54 | endif |
- | |
55 | - | ||
56 | ifdef TIMESTAMP |
- | |
57 | DEFS += "-DTIMESTAMP=\"$(TIMESTAMP)\"" |
- | |
58 | endif |
- | |
59 | - | ||
60 | ## Sources |
51 | ## Sources |
61 | # |
52 | # |
62 | 53 | ||
63 | OUTPUT = libc.so.0 |
54 | OUTPUT = libc.so.0 |
64 | 55 | ||
65 | .PHONY: all clean |
56 | .PHONY: all clean |
66 | 57 | ||
67 | all: $(OUTPUT) arch/$(ARCH)/_link.ld |
58 | all: $(OUTPUT) arch/$(UARCH)/_link.ld |
68 | 59 | ||
69 | inc: |
60 | inc: |
70 | ln -sfn ../arch/$(ARCH)/include include/arch |
61 | ln -sfn ../arch/$(UARCH)/include include/arch |
71 | 62 | ||
72 | -include Makefile.depend |
63 | -include Makefile.depend |
73 | 64 | ||
74 | clean: |
65 | clean: |
75 | -rm -f $(OUTPUT) $(OUTPUT).map $(OUTPUT).disasm $(OUTPUT).sections Makefile.depend *.o arch/$(ARCH)/_link.ld arch/$(ARCH)/_lib.ld include/arch |
66 | -rm -f $(OUTPUT) $(OUTPUT).map $(OUTPUT).disasm $(OUTPUT).sections Makefile.depend *.o arch/$(UARCH)/_link.ld arch/$(UARCH)/_lib.ld include/arch |
76 | find arch/$(ARCH)/ -name '*.o' -follow -exec rm \{\} \; |
67 | find arch/$(UARCH)/ -name '*.o' -follow -exec rm \{\} \; |
77 | 68 | ||
78 | $(OUTPUT): $(LIBS) arch/$(ARCH)/_lib.ld |
69 | $(OUTPUT): $(LIBS) arch/$(UARCH)/_lib.ld |
79 | $(LD) -T arch/$(ARCH)/_lib.ld $(LFLAGS) $(LIBS) -o $@ -Map $(OUTPUT).map |
70 | $(LD) -T arch/$(UARCH)/_lib.ld $(LFLAGS) $(LIBS) -o $@ -Map $(OUTPUT).map |
80 | 71 | ||
81 | arch/$(ARCH)/_lib.ld: arch/$(ARCH)/_lib.ld.in |
72 | arch/$(UARCH)/_lib.ld: arch/$(UARCH)/_lib.ld.in |
82 | $(CC) $(DEFS) $(CFLAGS) -DLIBC_PREFIX=$(LIBC_PREFIX) -E -x c $< | grep -v "^\#" > $@ |
73 | $(CC) $(DEFS) $(CFLAGS) -DLIBC_PREFIX=$(LIBC_PREFIX) -E -x c $< | grep -v "^\#" > $@ |
83 | 74 | ||
84 | arch/$(ARCH)/_link.ld: arch/$(ARCH)/_link.ld.in |
75 | arch/$(UARCH)/_link.ld: arch/$(UARCH)/_link.ld.in |
85 | $(CC) $(DEFS) $(CFLAGS) -DLIBC_PREFIX=$(APP_LIBC_PREFIX) -E -x c $< | grep -v "^\#" > $@ |
76 | $(CC) $(DEFS) $(CFLAGS) -DLIBC_PREFIX=$(APP_LIBC_PREFIX) -E -x c $< | grep -v "^\#" > $@ |