Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
  • 4 commits
  • 5 files changed
  • 0 commit comments
  • 1 contributor
3  software/bios/Makefile
View
@@ -24,6 +24,9 @@ bios-rescue.elf: linker-rescue.ld $(OBJECTS) libs
-lbase -lcompiler_rt
chmod -x $@
+%.o: %.c
+ $(compile-dep)
+
libs:
make -C $(M2DIR)/software/libbase
40 software/common.mak
View
@@ -1,20 +1,17 @@
-# Mico32 toolchain
-#
-CROSS_COMPILER=lm32-elf-
-# TODO: mico32 should be renamed lm32 in LLVM
-CLANG=clang -ccc-host-triple mico32-elf
+TARGET_PREFIX=lm32-elf
+CLANG=clang -ccc-host-triple $(TARGET_PREFIX)
CC_normal := $(CLANG)
-AR_normal := $(CROSS_COMPILER)ar
-LD_normal := $(CROSS_COMPILER)ld
-OBJCOPY_normal := $(CROSS_COMPILER)objcopy
-RANLIB_normal := $(CROSS_COMPILER)ranlib
+AR_normal := $(TARGET_PREFIX)-ar
+LD_normal := $(TARGET_PREFIX)-ld
+OBJCOPY_normal := $(TARGET_PREFIX)-objcopy
+RANLIB_normal := $(TARGET_PREFIX)-ranlib
CC_quiet = @echo " CC " $@ && $(CLANG)
-AR_quiet = @echo " AR " $@ && $(CROSS_COMPILER)ar
-LD_quiet = @echo " LD " $@ && $(CROSS_COMPILER)ld
-OBJCOPY_quiet = @echo " OBJCOPY " $@ && $(CROSS_COMPILER)objcopy
-RANLIB_quiet = @echo " RANLIB " $@ && $(CROSS_COMPILER)ranlib
+AR_quiet = @echo " AR " $@ && $(TARGET_PREFIX)-ar
+LD_quiet = @echo " LD " $@ && $(TARGET_PREFIX)-ld
+OBJCOPY_quiet = @echo " OBJCOPY " $@ && $(TARGET_PREFIX)-objcopy
+RANLIB_quiet = @echo " RANLIB " $@ && $(TARGET_PREFIX)-ranlib
ifeq ($(V),1)
CC = $(CC_normal)
@@ -40,11 +37,12 @@ LDFLAGS = -nostdlib -nodefaultlibs
# compile and generate dependencies, based on
# http://scottmcpeak.com/autodepend/autodepend.html
-%.o: $(SRCDIR)%.c
- $(CC) -c $(CFLAGS) $(SRCDIR)$*.c -o $*.o
- @$(CC_normal) -MM $(CFLAGS) $(SRCDIR)$*.c > $*.d
- @mv -f $*.d $*.d.tmp
- @sed -e 's|.*:|$*.o:|' < $*.d.tmp > $*.d
- @sed -e 's/.*://' -e 's/\\$$//' < $*.d.tmp | fmt -1 | \
- sed -e 's/^ *//' -e 's/$$/:/' >> $*.d
- @rm -f $*.d.tmp
+define compile-dep =
+$(CC) -c $(CFLAGS) $< -o $*.o
+@$(CC_normal) -MM $(CFLAGS) $< > $*.d
+@mv -f $*.d $*.d.tmp
+@sed -e 's|.*:|$*.o:|' < $*.d.tmp > $*.d
+@sed -e 's/.*://' -e 's/\\$$//' < $*.d.tmp | fmt -1 | \
+ sed -e 's/^ *//' -e 's/$$/:/' >> $*.d
+@rm -f $*.d.tmp
+endef
16 software/compiler-rt/lm32.mk
View
@@ -1,16 +0,0 @@
-Description := LatticeMico32
-
-Configs := lm32
-Arch := lm32
-
-CC := clang
-
-# TODO: mico32 should be renamed lm32 in LLVM
-CFLAGS := -Wall -Werror -O3 -D_YUGA_LITTLE_ENDIAN=0 -D_YUGA_BIG_ENDIAN=1 -ccc-host-triple mico32-elf
-
-FUNCTIONS := divsi3 modsi3 comparedf2 negsf2 negdf2 addsf3 subsf3 mulsf3 divsf3 \
- floatsisf floatunsisf fixsfsi fixunssfsi adddf3 subdf3 muldf3 divdf3 floatsidf floatunsidf fixdfsi fixunsdfsi
-
-# Those are already implemented in HW and should not be needed.
-# But the other functions directly depend on them.
-FUNCTIONS += udivsi3 lshrdi3 muldi3 ashldi3
6 software/include/base/stdio.h
View
@@ -12,6 +12,12 @@ int sprintf(char *buf, const char *fmt, ...);
int printf(const char *fmt, ...);
+/* Not sure this belongs here... */
+typedef long long loff_t;
+typedef long off_t;
+typedef int mode_t;
+typedef int dev_t;
+
/*
* Note: this library does not provide FILE operations.
* User code must implement them.
3  software/libbase/Makefile
View
@@ -12,6 +12,9 @@ libbase.a: $(OBJECTS)
$(AR) clr libbase.a $(OBJECTS)
$(RANLIB) libbase.a
+%.o: %.c
+ $(compile-dep)
+
.PHONY: clean
clean:

No commit comments for this range

Something went wrong with that request. Please try again.