timvideos / HDMI2USB-litex-firmware

A version of the HDMI2USB firmware based around LiteX tools produced by @Enjoy-Digital (based on misoc+migen created by @M-Labs)
https://hdmi2usb.tv
BSD 2-Clause "Simplified" License
145 stars 71 forks source link

make doesn't initialize recursive submodules #109

Open mithro opened 9 years ago

mithro commented 9 years ago

If the third_party/misoc submodule is initialized without a "--recursive" flag then you get the following error;

$ make gateware
cd third_party/misoc && python3 make.py -X ../.. -t opsis_hdmi2usb -Ot firmware_filename ../../firmware/lm32/firmware.bin -Op programmer urjtag  build-headers
                __  ___  _   ____     _____
               /  |/  / (_) / __/__  / ___/
              / /|_/ / / / _\ \/ _ \/ /__
             /_/  /_/ /_/ /___/\___/\___/

a high performance and small footprint SoC based on Migen

====== Building for: ======
Platform:  opsis
Target:    opsis_hdmi2usb
Subtarget: HDMI2USBSoC
CPU type:  lm32
===========================
make -C firmware/lm32 all
make[1]: Entering directory `/usr/local/google/home/tansell/foss/timvideos/hdmi2usb/HDMI2USB-misoc-firmware/firmware/lm32'
 CC       main.o
make -C ../../third_party/misoc/software/libcompiler-rt
make[2]: Entering directory `/usr/local/google/home/tansell/foss/timvideos/hdmi2usb/HDMI2USB-misoc-firmware/third_party/misoc/software/libcompiler-rt'
make[2]: *** No rule to make target `divsi3.o', needed by `libcompiler-rt.a'.  Stop.
make[2]: Leaving directory `/usr/local/google/home/tansell/foss/timvideos/hdmi2usb/HDMI2USB-misoc-firmware/third_party/misoc/software/libcompiler-rt'
make[1]: *** [libs] Error 2
make[1]: Leaving directory `/usr/local/google/home/tansell/foss/timvideos/hdmi2usb/HDMI2USB-misoc-firmware/firmware/lm32'
make: *** [firmware-lm32] Error 2
$ git status

Quick solution; make the gateware depend on the following .git files

./third_party/misoc/.git
./third_party/misoc/software/unwinder/.git
./third_party/misoc/software/compiler-rt/.git
./third_party/misoc/extcores/mor1kx/submodule/.git
./third_party/misoc/extcores/lm32/submodule/.git

Better solution: make the gateware depend automagically depend on any submodule recursively. It should work to depend on ./third_party/misoc/.gitmodules and pull the information out of that.

This is a low priority because the makefile should initialize the submodules with --recursive and so does the bootstrap.sh script.

mithro commented 9 years ago

@CarlFK -- You've seen this error right?

mithro commented 9 years ago

BTW The deliberately get you into this state is to do the following;

git submodule deinit third_party/misoc
git submodule init third_party/misoc
git submodule update third_party/misoc
make gateware

The output looks like;

$ git submodule deinit third_party/misoc                            
Cleared directory 'third_party/misoc'
Submodule 'third_party/misoc' (https://github.com/m-labs/misoc.git) unregistered for path 'third_party/misoc'
tansell@tansell-z620-l2:~/foss/timvideos/hdmi2usb/HDMI2USB-misoc-firmware$ git submodule init third_party/misoc                              
Submodule 'third_party/misoc' (https://github.com/m-labs/misoc.git) registered for path 'third_party/misoc'
tansell@tansell-z620-l2:~/foss/timvideos/hdmi2usb/HDMI2USB-misoc-firmware$ git submodule update third_party/misoc                            
Submodule path 'third_party/misoc': checked out '8e860e3aba736619e5c073196372837f3bc597c4'
tansell@tansell-z620-l2:~/foss/timvideos/hdmi2usb/HDMI2USB-misoc-firmware$ make gateware                                                     
cd third_party/misoc && python3 make.py -X ../.. -t opsis_hdmi2usb -Ot firmware_filename ../../firmware/lm32/firmware.bin -Op programmer urjtag  build-headers
                __  ___  _   ____     _____
               /  |/  / (_) / __/__  / ___/
              / /|_/ / / / _\ \/ _ \/ /__
             /_/  /_/ /_/ /___/\___/\___/

a high performance and small footprint SoC based on Migen

====== Building for: ======
....
make -C ../../third_party/misoc/software/libcompiler-rt
make[2]: Entering directory `/usr/local/google/home/tansell/foss/timvideos/hdmi2usb/HDMI2USB-misoc-firmware/third_party/misoc/software/libcompiler-rt'
make[2]: *** No rule to make target `divsi3.o', needed by `libcompiler-rt.a'.  Stop.
make[2]: Leaving directory `/usr/local/google/home/tansell/foss/timvideos/hdmi2usb/HDMI2USB-misoc-firmware/third_party/misoc/software/libcompiler-rt'
make[1]: *** [libs] Error 2
make[1]: Leaving directory `/usr/local/google/home/tansell/foss/timvideos/hdmi2usb/HDMI2USB-misoc-firmware/firmware/lm32'
make: *** [firmware-lm32] Error 2