Skip to content

Commit

Permalink
Auto-compile the util
Browse files Browse the repository at this point in the history
  • Loading branch information
clbr committed Dec 22, 2020
1 parent 5070a2c commit 5b0587c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ all: $(PROG_NAME)$(ROM_EXTENSION)
vmlinux = vmlinux.32
mydisk = mydisk

$(PROG_NAME)$(ROM_EXTENSION): $(PROG_NAME).elf
$(PROG_NAME)$(ROM_EXTENSION): $(PROG_NAME).elf util/size2bin
@$(OBJCOPY) $(PROG_NAME).elf $(PROG_NAME).bin -O binary
@rm -f $(PROG_NAME)$(ROM_EXTENSION)
@util/size2bin $(vmlinux) size.bin
Expand All @@ -48,6 +48,9 @@ $(PROG_NAME)$(ROM_EXTENSION): $(PROG_NAME).elf
$(PROG_NAME).elf : $(OBJS)
$(LD) -o $(PROG_NAME).elf $(OBJS) $(LINK_FLAGS)

util/size2bin:
$(MAKE) -C util

clean:
rm -f *.v64 *.z64 *.elf $(OBJS) *.bin

Expand Down
11 changes: 11 additions & 0 deletions util/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.PHONY: all clean

all: size2bin

CFLAGS = -Os -s -Wall -Wextra

size2bin: size2bin.o
$(CC) -o $@ $< $(CFLAGS)

clean:
rm -f size2bin *.o

0 comments on commit 5b0587c

Please sign in to comment.