Rev 4341 | 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 |
Line 46... | Line 45... | ||
46 | #LIBS = $(LIBC_PREFIX)/shared/libc.so.0 |
45 | #LIBS = $(LIBC_PREFIX)/shared/libc.so.0 |
47 | LIBS = |
46 | LIBS = |
48 | 47 | ||
49 | DEFS += -DRELEASE=\"$(RELEASE)\" |
48 | DEFS += -DRELEASE=\"$(RELEASE)\" |
50 | 49 | ||
51 | ifdef REVISION |
- | |
52 | DEFS += "-DREVISION=\"$(REVISION)\"" |
- | |
53 | endif |
- | |
54 | - | ||
55 | ifdef TIMESTAMP |
- | |
56 | DEFS += "-DTIMESTAMP=\"$(TIMESTAMP)\"" |
- | |
57 | endif |
- | |
58 | - | ||
59 | ## Sources |
50 | ## Sources |
60 | # |
51 | # |
61 | 52 | ||
62 | OUTPUT = libtest.so |
53 | OUTPUT = libtest.so |
63 | GENERIC_SOURCES = \ |
54 | GENERIC_SOURCES = \ |
Line 69... | Line 60... | ||
69 | .PHONY: all clean depend disasm sections inc |
60 | .PHONY: all clean depend disasm sections inc |
70 | 61 | ||
71 | all: $(OUTPUT) disasm sections |
62 | all: $(OUTPUT) disasm sections |
72 | 63 | ||
73 | inc: |
64 | inc: |
74 | ln -sfn ../arch/$(ARCH)/include include/arch |
65 | ln -sfn ../arch/$(UARCH)/include include/arch |
75 | 66 | ||
76 | -include Makefile.depend |
67 | -include Makefile.depend |
77 | 68 | ||
78 | clean: |
69 | clean: |
79 | -rm -f $(OUTPUT) $(OUTPUT).map $(OUTPUT).disasm $(OUTPUT).sections Makefile.depend *.o arch/$(ARCH)/_link.ld |
70 | -rm -f $(OUTPUT) $(OUTPUT).map $(OUTPUT).disasm $(OUTPUT).sections Makefile.depend *.o arch/$(UARCH)/_link.ld |
80 | find arch/$(ARCH)/ -name '*.o' -follow -exec rm \{\} \; |
71 | find arch/$(UARCH)/ -name '*.o' -follow -exec rm \{\} \; |
81 | 72 | ||
82 | depend: |
73 | depend: |
83 | $(CC) $(DEFS) $(CFLAGS) -M $(ARCH_SOURCES) $(GENERIC_SOURCES)> Makefile.depend |
74 | $(CC) $(DEFS) $(CFLAGS) -M $(ARCH_SOURCES) $(GENERIC_SOURCES)> Makefile.depend |
84 | 75 | ||
85 | $(OUTPUT): $(ARCH_OBJECTS) $(GENERIC_OBJECTS) $(LIBS) arch/$(ARCH)/_link.ld |
76 | $(OUTPUT): $(ARCH_OBJECTS) $(GENERIC_OBJECTS) $(LIBS) arch/$(UARCH)/_link.ld |
86 | $(LD) -T arch/$(ARCH)/_link.ld $(ARCH_OBJECTS) $(GENERIC_OBJECTS) $(LIBS) $(LFLAGS) -o $@ -Map $(OUTPUT).map |
77 | $(LD) -T arch/$(UARCH)/_link.ld $(ARCH_OBJECTS) $(GENERIC_OBJECTS) $(LIBS) $(LFLAGS) -o $@ -Map $(OUTPUT).map |
87 | 78 | ||
88 | disasm: |
79 | disasm: |
89 | $(OBJDUMP) -d -S -s $(OUTPUT) >$(OUTPUT).disasm |
80 | $(OBJDUMP) -d -S -s $(OUTPUT) >$(OUTPUT).disasm |
90 | 81 | ||
91 | sections: |
82 | sections: |
92 | $(OBJDUMP) -h $(OUTPUT) >$(OUTPUT).sections |
83 | $(OBJDUMP) -h $(OUTPUT) >$(OUTPUT).sections |
93 | 84 | ||
94 | arch/$(ARCH)/_link.ld: arch/$(ARCH)/_link.ld.in |
85 | arch/$(UARCH)/_link.ld: arch/$(UARCH)/_link.ld.in |
95 | $(CC) $(DEFS) $(CFLAGS) -DLIBC_PREFIX=$(LIBC_PREFIX) -E -x c $< | grep -v "^\#" > $@ |
86 | $(CC) $(DEFS) $(CFLAGS) -DLIBC_PREFIX=$(LIBC_PREFIX) -E -x c $< | grep -v "^\#" > $@ |
96 | 87 | ||
97 | %.o: %.S |
88 | %.o: %.S |
98 | $(CC) $(DEFS) $(AFLAGS) $(CFLAGS) -D__ASM__ -c $< -o $@ |
89 | $(CC) $(DEFS) $(AFLAGS) $(CFLAGS) -D__ASM__ -c $< -o $@ |
99 | 90 |