5e29ab5c1287f6e59d5a72ce0a91ff355756bcf1
Stefan Schuermans implemented switches

Stefan Schuermans authored 12 years ago

1) SRCS=cyc_cnt.c lcd.c leds.c main.c switches.c
Stefan Schuermans added "LEDs" I/O peripheral...

Stefan Schuermans authored 12 years ago

2) 
Stefan Schuermans implemented loading of data...

Stefan Schuermans authored 12 years ago

3) PERL=perl
Stefan Schuermans initial firmware and testbed

Stefan Schuermans authored 12 years ago

4) CC=mipsel-elf-gcc
5) LD=mipsel-elf-ld
6) OBJCOPY=mipsel-elf-objcopy
Stefan Schuermans added "LEDs" I/O peripheral...

Stefan Schuermans authored 12 years ago

7) CFLAGS=-Wall -Wextra -mips1 -mno-abicalls
8) LFLAGS=-mips1
9) 
10) BASES=$(patsubst %.c,%,$(SRCS))
11) DEPS=$(addsuffix .d,$(BASES))
12) OBJS=$(addsuffix .o,$(BASES))
13) 
14) .PHONY: all clean
Stefan Schuermans implemented loading of data...

Stefan Schuermans authored 12 years ago

15) .SUFFIXES:
16) .SECONDARY:
Stefan Schuermans added "LEDs" I/O peripheral...

Stefan Schuermans authored 12 years ago

17) 
Stefan Schuermans implemented loading of data...

Stefan Schuermans authored 12 years ago

18) all: rom.vhd ram.0.vhd ram.1.vhd ram.2.vhd ram.3.vhd
Stefan Schuermans added "LEDs" I/O peripheral...

Stefan Schuermans authored 12 years ago

19) 
20) ifneq ($(MAKECMDGOALS),clean)
21)   include deps
22) endif
Stefan Schuermans initial firmware and testbed

Stefan Schuermans authored 12 years ago

23) 
Stefan Schuermans added "LEDs" I/O peripheral...

Stefan Schuermans authored 12 years ago

24) deps: $(DEPS)
25) 	cat /dev/null $^ >$@
Stefan Schuermans initial firmware and testbed

Stefan Schuermans authored 12 years ago

26) 
Stefan Schuermans added "LEDs" I/O peripheral...

Stefan Schuermans authored 12 years ago

27) %.d: %.c Makefile
28) 	$(CC) $(CFLAGS) -M -o $@ $<
Stefan Schuermans initial firmware and testbed

Stefan Schuermans authored 12 years ago

29) 
Stefan Schuermans added "LEDs" I/O peripheral...

Stefan Schuermans authored 12 years ago

30) %.o: %.c Makefile
Stefan Schuermans initial firmware and testbed

Stefan Schuermans authored 12 years ago

31) 	$(CC) $(CFLAGS) -c -o $@ $<
32) 
Stefan Schuermans added "LEDs" I/O peripheral...

Stefan Schuermans authored 12 years ago

33) %.o: %.s Makefile
Stefan Schuermans initial firmware and testbed

Stefan Schuermans authored 12 years ago

34) 	$(CC) $(CFLAGS) -c -o $@ $<
35) 
Stefan Schuermans added "LEDs" I/O peripheral...

Stefan Schuermans authored 12 years ago

36) fw.o: $(OBJS)
Stefan Schuermans initial firmware and testbed

Stefan Schuermans authored 12 years ago

37) 	$(LD) $(LFLAGS) -r -o $@ $^
38) 
39) fw: lnk.cmd boot.o fw.o
40) 	$(LD) $(LFLAGS) -T lnk.cmd -o $@ boot.o fw.o
41) 
Stefan Schuermans implemented loading of data...

Stefan Schuermans authored 12 years ago

42) %.bin: fw
43) 	$(OBJCOPY) -j .$(basename $@) -O binary $< $@
Stefan Schuermans initial firmware and testbed

Stefan Schuermans authored 12 years ago

44) 
Stefan Schuermans implemented loading of data...

Stefan Schuermans authored 12 years ago

45) rom.vhd: rom.pl rom.bin
46) 	$(PERL) rom.pl rom.bin >$@
47) 
48) ram.%.vhd: ram.pl ram.bin
49) 	$(PERL) ram.pl ram.bin $(patsubst ram.%.vhd,%,$@) >$@
Stefan Schuermans initial firmware and testbed

Stefan Schuermans authored 12 years ago

50) 
51) clean:
Stefan Schuermans implemented loading of data...

Stefan Schuermans authored 12 years ago

52) 	rm -f $(DEPS) $(OBJS)
53) 	rm -f boot.o fw.o fw
54) 	rm -f rom.bin rom.vhd
55) 	rm -f ram.bin ram.[0-3].vhd