Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

comedi: ni_routing: tools: Update due to moved COMEDI headers

Building of the tools for converting the NI routing information between
CSV files (for maintenance) and C files (for building) was broken by the
move of the main COMEDI header files to "include/uapi/linux/" and
"include/linux/". (These tools are not built as part of the normal
kernel build process.) Fix it in the Makefile.

A slight niggle is that `#include <linux/comedi.h>` needs to work when
compiling the `convert_c_to_py` program, but it cannot use a `-I` option
referring to the "uapi" include directory because that interferes with
inclusion of other system headers. So it uses `-I.` and makes a local
copy (actually a symbolic link) as "./linux/comedi.h".

Also remove some unneeded cruft such as the `-D"BIT(x)=(1<<(x))"`
preprocessor flag.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Link: https://lore.kernel.org/r/20211117120604.117740-3-abbotti@mev.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Ian Abbott and committed by
Greg Kroah-Hartman
55d0f80e df0e68c1

+19 -11
+1
drivers/comedi/drivers/ni_routing/tools/.gitignore
··· 5 5 convert_c_to_py 6 6 c/ 7 7 csv/ 8 + linux/ 8 9 all_cfiles.c
+18 -11
drivers/comedi/drivers/ni_routing/tools/Makefile
··· 3 3 # ni_route_values.h 4 4 # ni_device_routes.h 5 5 # in order to do this, we are also generating a python representation (using 6 - # ctypesgen) of ../../comedi.h. 6 + # ctypesgen) of ../../../../../include/uapi/linux/comedi.h. 7 7 # This allows us to sort NI signal/terminal names numerically to use a binary 8 8 # search through the device_routes tables to find valid routes. 9 9 ··· 30 30 31 31 everything : csv-files c-files csv-blank 32 32 33 - CPPFLAGS=-D"BIT(x)=(1UL<<(x))" -D__user= 33 + CPPFLAGS = -D__user= 34 + INC_UAPI = ../../../../../include/uapi 34 35 35 - comedi_h.py : ../../../comedi.h 36 + comedi_h.py: $(INC_UAPI)/linux/comedi.h 36 37 ctypesgen $< --include "sys/ioctl.h" --cpp 'gcc -E $(CPPFLAGS)' -o $@ 37 38 38 - convert_c_to_py: all_cfiles.c 39 - gcc -g convert_c_to_py.c -o convert_c_to_py -std=c99 39 + convert_c_to_py: all_cfiles.c linux/comedi.h 40 + gcc -g -I. convert_c_to_py.c -o convert_c_to_py -std=c99 41 + 42 + # Create a local 'linux/comedi.h' for use when compiling 'convert_c_to_py.c' 43 + # with the '-I.' option. (Cannot specify '-I../../../../../include/uapi' 44 + # because that interferes with inclusion of other system headers.) 45 + linux/comedi.h: $(INC_UAPI)/linux/comedi.h 46 + mkdir -p linux 47 + ln -snf ../$< $@ 40 48 41 49 ni_values.py: convert_c_to_py 42 50 ./convert_c_to_py ··· 52 44 csv-files : ni_values.py comedi_h.py 53 45 ./convert_py_to_csv.py 54 46 55 - csv-blank : 47 + csv-blank : comedi_h.py 56 48 ./make_blank_csv.py 57 49 @echo New blank csv signal table in csv/blank_route_table.csv 58 50 ··· 70 62 $(RM) -rf comedi_h.py ni_values.py convert_c_to_py all_cfiles.c *.pyc \ 71 63 __pycache__/ 72 64 73 - clean : partial_clean 74 - $(RM) -rf c/ csv/ 65 + clean : clean-partial 66 + $(RM) -rf c/ csv/ linux/ 75 67 76 68 # Note: One could also use ctypeslib in order to generate these files. The 77 69 # caveat is that ctypeslib does not do a great job at handling macro functions. 78 70 # The make rules are as follows: 79 - # comedi.h.xml : ../../comedi.h 71 + # comedi.h.xml : $(INC_UAPI)/linux/comedi.h 80 72 # # note that we have to use PWD here to avoid h2xml finding a system 81 73 # # installed version of the comedilib/comedi.h file 82 - # h2xml ${PWD}/../../comedi.h -c -D__user="" -D"BIT(x)=(1<<(x))" \ 83 - # -o comedi.h.xml 74 + # h2xml ${PWD}/$(INC_UAPI)/linux/comedi.h -c D__user="" -o comedi.h.xml 84 75 # 85 76 # comedi_h.py : comedi.h.xml 86 77 # xml2py ./comedi.h.xml -o comedi_h.py