Commit b74ebbfe authored by Alessandro Rubini's avatar Alessandro Rubini

Makefile: fetch submodules if needed at build time

Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <>
parent 27413100
......@@ -80,12 +80,12 @@ OUTPUT = wrc
REVISION=$(shell git describe --dirty --always)
all: tools $(OUTPUT).ram $(OUTPUT).vhd $(OUTPUT).elf
all: tools $(OUTPUT).ram $(OUTPUT).vhd
.PRECIOUS: %.elf %.bin
.PHONY: all tools clean
.PHONY: all tools clean gitmodules
$(OUTPUT).elf: silentoldconfig $(OBJS)
$(OUTPUT).elf: silentoldconfig gitmodules $(OBJS)
$(CC) $(CFLAGS) -DGIT_REVISION=\"$(REVISION)\" -c revision.c
${CC} -o $@ revision.o $(OBJS) $(LDFLAGS)
${OBJDUMP} -d $(OUTPUT).elf > $(OUTPUT)_disasm.S
......@@ -115,6 +115,15 @@ clean:
$(MAKE) -C tools
# if needed, check out the submodules (first time only), so users
# who didn't read carefully the manual won't get confused
@test -d ptp-noposix/libposix || echo "Checking out submodules"
@test -d ptp-noposix/libposix || \
git submodule init && git submodule update
# following targets from Makefile.kconfig
@mkdir -p include/config
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment