att / vfd

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Top level build script

ScottDaniels opened this issue · comments

It would be nice to have a script at the top most directory which builds everything.

@ScottDaniels
Would this script just build the jsmn, libvfd and vfd src ? Or we are assuming here, the dpdk is not built and even that needs to be built ?

@tkekan
My assumption is that we would not build dpdk and just build the libraries and vfd src. We have a few unit tests in the library directory and as a bonus it might offer the option to build and run those as a part of building the library.

With respect to building the dpdk library, someone might be checking out and building a different branch/tag and./or making modifications that require a different process to build it. We should assume it's built and that the RTE_ variables are properly established in the environment. Script probably should check to see that the RTE variables look good, but running make in the VFd source directory will fail if they aren't good, so that would be only a nice to have.

If that is the case, I use a simple make file in my top src directory that builds the libraries and vfd src. The output looks as below:
But as you are mentioning that this script should check whether the RTE_ variables are properly set. In that case, what I see is, those checks are already present in the Makefile inside the vfd directory.
So, are we looking to create a independent Makefile in the src directory that wouldn't use the functionality of the Makefiles that are currently present ? Or is something below good ?

vfd/src# make all
(cd lib; make jsmn && make libvfd.a)
make[1]: Entering directory /root/vfd/src/lib' make[1]: jsmn' is up to date.
make[1]: Leaving directory /root/vfd/src/lib' make[1]: Entering directory /root/vfd/src/lib'
make[1]: libvfd.a' is up to date. make[1]: Leaving directory /root/vfd/src/lib'
(cd vfd; make clean && make)
make[1]: Entering directory /root/vfd/src/vfd' rm -rf build make[1]: Leaving directory /root/vfd/src/vfd'
make[1]: Entering directory /root/vfd/src/vfd' /root/vfd/src/vfd/Makefile:62: warning: overriding commands for target clean'
/root/vfd/src/lib/dpdk/mk/rte.app.mk:266: warning: ignoring old commands for target clean' CC main.o CC sriov.o CC qos.o CC vfd_rif.o CC vfd_dcb.o LD vfd INSTALL-APP vfd INSTALL-MAP vfd.map make[1]: Leaving directory /root/vfd/src/vfd'


Contents of the Makefile inside vfd/src

all:
(cd lib; make jsmn && make libvfd.a)
(cd vfd; make clean && make)

clean:
(cd lib; make nuke)
(cd vfd; make clean)

@tkekan
That looks like a fine addition. Why don't you add that and issue a pull request and we'll merge it at the top level. Once that's done I'll mark this closed and should we ever need something more than just a make to add checks etc, we can open a new issue. For now, just having a simple way to build all without having to know understand the structure is a big plus.

Closed. Previously discussed Makefile merged in commit 7f42ca3.