|
- PREFIX=mips-elf-
- CC=$(PREFIX)gcc
- AS=$(PREFIX)as
- OBJCOPY=$(PREFIX)objcopy
-
- CFLAGS=-Os -Wall -msoft-float -fomit-frame-pointer -I../libplasma/include -I../libhex/include -DPLASMA_PWM
- LDFLAGS=-nostdlib -msoft-float -Wl,-Ttext,0x10000008
- #LIBS=-lm -lgcc -lc
- LIBS=-lgcc
-
- OBJ=init.o main.o
-
- all: image
-
- transfer: image
- ./transfer.sh
-
- image: main.bin loader.bin
- cat loader.bin main.bin > image
-
- main.bin: main.elf
- $(OBJCOPY) -O binary main.elf main.bin
-
- loader.bin: create_loader.sh main.elf
- ./create_loader.sh
- $(AS) -o loader.o loader.s
- $(OBJCOPY) -O binary loader.o loader.bin
-
- init.o: init.s
- $(AS) -o init.o init.s
-
- main.elf: $(OBJ)
- $(CC) $(LDFLAGS) -o main.elf $(OBJ) $(LIBS)
-
- clean:
- rm -f *.o *.bin
- rm -f *~
- rm -f main.elf
- rm -f image
- rm -rf ../libhex/src/*.o ../libplasma/src/*.o
|