Open gilles-peskine-arm opened 8 months ago
we already have a makefile generator system, in CMake.
Yes, but it's not good at its job.
I would prefer to ship a very simple hand-written Makefile. We can be conservative about dependencies if that's a concern, i.e. rebuild everything if a .h file changes, etc.
That might be ok for users, but it's no good for maintainers. Part of the reason I wrote mbedtls-prepare-build
is to save time for myself. Even as the sole user, it's been well worth the time.
I am not sure about what you mean by "First step towards https://github.com/Mbed-TLS/TF-PSA-Crypto/issues/65."?
The test components referenced by issue 65 use specific C compiler flags but having played a bit with it it seems possible to do that with cmake using something like cmake -DCMAKE_C_FLAGS=String:"-Werror -Wall -Wextra -mpclmul -msse2 -maes" ..
for example.
I am not sure about what you mean by "First step towards #65."?
Typo: I meant #85.
I am not sure about what you mean by "First step towards #65."?
Typo: I meant #85.
Ah, I could have guessed that, thanks.
Another thing that doesn't work with cmake (both in mbedtls and in tf-psa-crypto):
$ rm programs/psa/psa_constant_names
$ make programs/psa/psa_constant_names
make: *** No rule to make target 'programs/psa/psa_constant_names'. Stop.
Running make
builds everything, but I have no idea how to build a specific program.
Another thing that doesn't work with cmake (both in mbedtls and in tf-psa-crypto):
$ rm programs/psa/psa_constant_names $ make programs/psa/psa_constant_names make: *** No rule to make target 'programs/psa/psa_constant_names'. Stop.
Running
make
builds everything, but I have no idea how to build a specific program.
In CMake files we define the psa_constant_names
target, thus make psa_constant_names
just builds the psa_const_names
program.
First step towards #85.
Introduce a Python script that generates a makefile.
The design is heavily based on
mbedtls-prepare-build
. Most of the code is copied from there, but I took the opportunity to clean it up.This is incomplete and not yet usable for daily work. I don't want to put further time into it until the design and current code is approved.
Current features:
lib
,clean
,help
, .include/tf_psa_crypto/version.h
. This part is very ugly because the template file's format relies heavily on CMake, and I think the best way format would be to change the way this template works. But that's a job for a follow-up.Features to be added in follow-ups:
*config.h
) in the build tree.CFLAGS
and such.libtestdriver1