.gitignore contains .c and .h ?
Hello.
The .gitignore in the master branch contains the following lines :
/qapi-types.[ch]
/qapi-visit.[ch]
/qapi-event.[ch]
Why is it so ? Are they generated automatically each time I compile the project ? I am modifying qapi-types.h and qapi-types.c , am I doing wrong ?
regards, Guillaume
Quoted 10 lines · On Mon, 04 May 2015 09:47:11 +0200 Guillaume Le Louët…
Hello.
The .gitignore in the master branch contains the following lines :
/qapi-types.[ch]
/qapi-visit.[ch]
/qapi-event.[ch]Why is it so ? Are they generated automatically each time I compile the project ?
I am modifyingqapi-types.handqapi-types.c, am I doing wrong ?
Yes, they are created automatically and you should not edit them manually. Just have a look at the main Makefile:
qapi-modules = $(SRC_PATH)/qapi-schema.json $(SRC_PATH)/qapi/common.json \
$(SRC_PATH)/qapi/block.json $(SRC_PATH)/qapi/block-core.json \
$(SRC_PATH)/qapi/event.jsonqapi-types.c qapi-types.h :\
$(qapi-modules) $(SRC_PATH)/scripts/qapi-types.py $(qapi-py)
$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-types.py \
$(gen-out-type) -o "." -b -i $<, \
" GEN $@")So if you want to change something in this area, you likely have to touch the *.json files instead.
Thomas
You're right, I noticed that compiling with make was removing my modifications. I ended up modifying the qapi-schema.json .
May I advise to move the generated .c and .h files into a generated/ folder ?
Thank you Thomas.
Quoted 30 lines · Thomas Huth
Quoted 10 lines · On Mon, 04 May 2015 09:47:11 +0200 Guillaume Le Louët…
Hello.
The .gitignore in the master branch contains the following lines :
/qapi-types.[ch]
/qapi-visit.[ch]
/qapi-event.[ch]Why is it so ? Are they generated automatically each time I compile the project ?
I am modifyingqapi-types.handqapi-types.c, am I doing wrong ?Yes, they are created automatically and you should not edit them manually. Just have a look at the main
Makefile:qapi-modules = $(SRC_PATH)/qapi-schema.json $(SRC_PATH)/qapi/common.json \ $(SRC_PATH)/qapi/block.json $(SRC_PATH)/qapi/block-core.json \ $(SRC_PATH)/qapi/event.json
qapi-types.cqapi-types.h:\
$(qapi-modules) $(SRC_PATH)/scripts/qapi-types.py $(qapi-py)$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-types.py \ $(gen-out-type) -o "." -b -i $<, \ " GEN $@")So if you want to change something in this area, you likely have to touch the *.json files instead.
Thomas
Quoted 6 lines · Guillaume Le Louët
You're right, I noticed that compiling with make was removing my modifications.
I ended up modifying the qapi-schema.json .May I advise to move the generated .c and .h files into a generated/ folder ?
If you want to keep generated files out of your source tree
I would recommend using a separate build tree:
mkdir build/whatever && (cd build/whatever && ../../configure [args here]) make -C build/whatever
(You'll need to distclean your tree first if you've been doing in-source-tree builds.)
-- PMM