Fix build makefiles
This commit is contained in:
parent
7a32aa503c
commit
e170256c9b
@ -1,5 +1,11 @@
|
||||
include $(TOPDIR)/Makefile.config
|
||||
|
||||
USERLIB = $(TOPDIR)/userlib
|
||||
|
||||
AS = $(RISCV_AS) -c
|
||||
GCC = $(RISCV_GCC)
|
||||
LD = $(RISCV_LD)
|
||||
|
||||
INCPATH += -I$(TOPDIR) -I$(USERLIB)
|
||||
LDFLAGS = $(RISCV_LDFLAGS) -T $(USERLIB)/ldscript.lds
|
||||
ASFLAGS = $(RISCV_ASFLAGS) $(INCPATH)
|
||||
@ -7,16 +13,16 @@ CFLAGS = $(RISCV_CFLAGS) $(INCPATH)
|
||||
|
||||
# Rules
|
||||
%.o: %.s
|
||||
$(RISCV_AS) $(ASFLAGS) -c $<
|
||||
$(AS) $(ASFLAGS) -c $<
|
||||
|
||||
%.o: %.c
|
||||
$(RISCV_GCC) $(CFLAGS) -c $<
|
||||
$(GCC) $(CFLAGS) -c $<
|
||||
|
||||
%.dump: %.o
|
||||
$(RISCV_OBJCOPY) -j .text -O $(DUMP_FORMAT) $< $@
|
||||
|
||||
%.guac: %.o
|
||||
$(RISCV_LD) $(LDFLAGS) $+ -o $@
|
||||
$(LD) $(LDFLAGS) $+ -o $@
|
||||
|
||||
# Dependencies
|
||||
.%.d: %.s
|
||||
@ -31,6 +37,9 @@ CFLAGS = $(RISCV_CFLAGS) $(INCPATH)
|
||||
| sed '\''s/\($*\)\.o[ :]*/\1.o $@ : /g'\'' > $@; \
|
||||
[ -s $@ ] || rm -f $@'
|
||||
|
||||
$(PROGRAMS):
|
||||
$(LD) $(LDFLAGS) $+ -o $@
|
||||
|
||||
# Targets
|
||||
#clean:
|
||||
# rm -rf *.o 2> /dev/null
|
||||
|
5
test/riscv_instructions/.gitignore
vendored
Normal file
5
test/riscv_instructions/.gitignore
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
*
|
||||
!.gitignore
|
||||
!*.c
|
||||
!*.md
|
||||
!**/Makefile
|
@ -1,7 +1,7 @@
|
||||
build:
|
||||
make build -C boolean_logic/
|
||||
# make build -C jump_instructions/
|
||||
# make build -C simple_arithmetics/
|
||||
make build -C jump_instructions/
|
||||
make build -C simple_arithmetics/
|
||||
|
||||
dumps:
|
||||
make dumps -C boolean_logic/
|
||||
|
@ -1,11 +1,17 @@
|
||||
TOPDIR = ../..
|
||||
include $(TOPDIR)/Makefile.tests
|
||||
|
||||
build: comparisons if switch
|
||||
PROGRAMS = comparisons if switch
|
||||
|
||||
build: $(PROGRAMS)
|
||||
|
||||
dumps: comparisons.dump if.dump switch.dump
|
||||
|
||||
tests: comparisons.guac if.guac switch.guac
|
||||
|
||||
TOPDIR = ../..
|
||||
include $(TOPDIR)/Makefile.tests
|
||||
|
||||
clean:
|
||||
$(RM) comparisons comparisons.o if if.o
|
||||
|
||||
# Dependances
|
||||
$(PROGRAMS): % : $(USERLIB)/sys.o $(USERLIB)/libnachos.o %.o
|
@ -1,6 +1,15 @@
|
||||
TOPDIR = ../..
|
||||
include $(TOPDIR)/Makefile.tests
|
||||
PROGRAMS = jump ret
|
||||
|
||||
build: $(PROGRAMS)
|
||||
|
||||
dumps: jump.dump ret.dump
|
||||
|
||||
tests: jump.guac ret.guac
|
||||
tests: jump.guac ret.guac
|
||||
|
||||
clean:
|
||||
$(RM) jump jump.o ret ret.o
|
||||
|
||||
TOPDIR = ../..
|
||||
include $(TOPDIR)/Makefile.tests
|
||||
|
||||
$(PROGRAMS): % : $(USERLIB)/sys.o $(USERLIB)/libnachos.o %.o
|
@ -1,6 +1,16 @@
|
||||
TOPDIR = ../..
|
||||
include $(TOPDIR)/Makefile.tests
|
||||
|
||||
PROGRAMS = unsigned_addition unsigned_division unsigned_multiplication unsigned_substraction
|
||||
|
||||
build: $(PROGRAMS)
|
||||
|
||||
dumps: unsigned_addition.dump unsigned_division.dump unsigned_multiplication.dump unsigned_substraction.dump
|
||||
|
||||
tests: unsigned_addition.guac unsigned_division.guac unsigned_multiplication.guac unsigned_substraction.guac
|
||||
tests: unsigned_addition.guac unsigned_division.guac unsigned_multiplication.guac unsigned_substraction.guac
|
||||
|
||||
clean:
|
||||
$(RM) unsigned_addition unsigned_addition.o unsigned_division unsigned_division.o unsigned_multiplication unsigned_multiplication.o unsigned_substraction unsigned_substraction.o
|
||||
|
||||
TOPDIR = ../..
|
||||
include $(TOPDIR)/Makefile.tests
|
||||
|
||||
$(PROGRAMS): % : $(USERLIB)/sys.o $(USERLIB)/libnachos.o %.o
|
Loading…
Reference in New Issue
Block a user