Method and device for automatically generating compilation configuration file, electronic equipment and storage medium

CN115437639BActive Publication Date: 2026-06-02SHENZHEN JAGUAR MICROSYSTEMS CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SHENZHEN JAGUAR MICROSYSTEMS CO LTD
Filing Date
2022-08-24
Publication Date
2026-06-02

Smart Images

  • Figure CN115437639B_ABST
    Figure CN115437639B_ABST
Patent Text Reader

Abstract

The application discloses an automatic generation method of a compilation configuration file, and at least comprises the following steps: separating a to-be-compiled file and a compilation rule in a software engineering, and generating a first compilation configuration file only comprising the compilation rule; searching the to-be-compiled file under a directory tree where the software engineering is located by using a pre-written compilation configuration file automatic generation tool; and saving the searched to-be-compiled file and the corresponding directory in a second compilation configuration file in the form of a file list and a directory list respectively, wherein the second compilation configuration file is contained in the first compilation configuration file through a file containing instruction. The application further discloses a corresponding device, an electronic device and a storage medium. By implementing the application, the compilation configuration file can be automatically generated efficiently and at low cost.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of data processing technology, and in particular to a method, apparatus, electronic device, and storage medium for automatically generating compilation configuration files. Background Technology

[0002] CMake is a cross-platform installation (compilation) tool that can describe the installation (compilation) process for all platforms using simple statements. CMake can output various Makefiles or project files. A project contains countless source files, organized by type, function, and module into several directories. The Makefile defines a series of rules to specify which files need to be compiled first, which need to be compiled later, which need to be recompiled, and even perform more complex operations. Because a Makefile is like a shell script, it can also execute operating system commands.

[0003] Writing a Makefile is extremely complex for a large software project. Currently, the CMake utility typically reads all source files and automatically generates the Makefile based on the CMakeLists.txt configuration file. However, this existing method of generating Makefiles using CMake has the following drawbacks:

[0004] Since CMake is a third-party tool, it needs to be downloaded and installed, which is quite inconvenient to install on a computer without a network connection.

[0005] Meanwhile, the CMake tool requires a configuration file "CMakeLists.txt" to be set in each directory of the software project, resulting in a large number of configuration files. If the list of compiled files needs to be updated, many configuration files need to be maintained manually, which is a huge workload. Summary of the Invention

[0006] The technical problem to be solved by this invention is to provide a method, apparatus, electronic device, and storage medium for automatically generating compilation configuration files. This allows for the efficient and low-cost automatic generation of compilation configuration files.

[0007] To address the aforementioned technical problems, as one aspect of the present invention, a method for automatically generating compilation configuration files is provided, which includes at least the following steps:

[0008] In software engineering, the files to be compiled and the compilation rules are separated to generate a first compilation configuration file that only includes the compilation rules. The compilation rules include at least the compilation order of the files to be compiled, the linking rules, and the format of the executable file to be generated.

[0009] Using a pre-written automatic compilation configuration file generation tool, the system searches for files to be compiled in the directory tree where the software project is located. The searched files to be compiled and their corresponding directories are saved as file lists and directory lists in an automatically generated second compilation configuration file, which is included in the first compilation configuration file via a file inclusion directive.

[0010] The step of separating the files to be compiled and the compilation rules in the software engineering and generating a first compilation configuration file that only includes the compilation rules further includes:

[0011] The second compilation configuration file is loaded into a file variable via a file inclusion directive;

[0012] The dependencies of the files to be compiled are obtained based on the file variables, and the compilation order, linking rules, and format of the executable files to be generated are determined.

[0013] The step of using a pre-written compilation configuration file automatic generation tool to search for files to be compiled in the directory tree where the software project is located further includes:

[0014] Based on the pre-written compilation configuration file automatic generation tool, determine the list of files and directories that need to be filtered;

[0015] Search all files and directories under the directory tree where the software project is located, filter the file and directory lists as needed, exclude the files and directories that need to be filtered, and obtain the files to be compiled and their corresponding directories.

[0016] The names of the files to be compiled and their corresponding directories are formatted.

[0017] The formatted names of the files to be compiled and their corresponding directories are written into the automatically generated second compilation configuration file as a file list and a target list, respectively.

[0018] The pre-written compilation configuration file automatic generation tool is an automatically executed script file, which at least defines a list of files and a list of directories to be filtered.

[0019] The feature is that it further includes:

[0020] The compilation command is executed to compile the first compilation configuration file and generate an executable file in the format determined by the first compilation configuration file.

[0021] As another aspect of the present invention, an automatic compilation configuration file generation apparatus is also provided, which includes at least:

[0022] The first compilation configuration file generation unit is used to separate the files to be compiled and the compilation rules in the software project, and generate a first compilation configuration file that only includes the compilation rules. The compilation rules include at least the compilation order of the files to be compiled, the linking rules, and the format of the executable file to be generated.

[0023] The second compiler configuration file automatic generation unit is used to search for files to be compiled under the directory tree where the software project is located using a pre-written compiler configuration file automatic generation tool; the searched files to be compiled and their corresponding directories are saved in the automatically generated second compiler configuration file in the form of a file list and a directory list, respectively. The second compiler configuration file is included in the first compiler configuration file through a file inclusion directive.

[0024] The first compilation configuration file generation unit further includes:

[0025] The file variable loading unit is used to load the second compilation configuration file into a file variable via a file inclusion directive.

[0026] The compilation rule determination unit is used to obtain the dependency relationship of the file to be compiled based on the file variable, and to determine the compilation order, linking rules and the format of the executable file to be generated.

[0027] The second automatic compilation configuration file generation unit further includes:

[0028] The filtering content determination unit is used to determine the list of file directories and the list of directories to be filtered based on the pre-written compilation configuration file automatic generation tool.

[0029] The filtering unit is used to search all files and directories under the directory tree where the software project is located, and exclude the files and directories that need to be filtered according to the file list and directory list to be filtered, so as to obtain the file to be compiled and the corresponding directory.

[0030] The formatting processing unit is used to format the names of the file to be compiled and the corresponding directory.

[0031] The second compilation configuration file forming unit is used to write the formatted names of the files to be compiled and their corresponding directories into the automatically generated second compilation configuration file in the form of a file list and a directory list, respectively.

[0032] This further includes:

[0033] The compilation processing unit is used to execute compilation processing commands to compile the first compilation configuration file and generate an executable file in the format determined by the first compilation configuration file.

[0034] The pre-written compilation configuration file automatic generation tool is an automatically executed script file, which at least defines a list of file directories to be filtered and a list of directories.

[0035] Accordingly, in another aspect, the present invention also provides an electronic device including a memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory storing computer instructions, characterized in that the processor executes the computer instructions to perform the aforementioned method for automatically generating a compilation configuration file.

[0036] Accordingly, another aspect of the present invention also provides a computer-readable storage medium storing computer instructions for causing a computer to execute the aforementioned method for automatically generating a compilation configuration file.

[0037] Implementing the embodiments of the present invention has the following beneficial effects:

[0038] This invention provides a method, apparatus, electronic device, and storage medium for automatically generating compilation configuration files. By separating the compilation rules in the Makefile from the file to be compiled, a first compilation configuration file containing only the compilation rules is generated. A second compilation configuration file is automatically generated using a pre-written compilation configuration file automatic generation tool. At the same time, a file inclusion directive is used to associate the first and second compilation configuration files. This invention can replace the existing solution of generating Makefiles using CMake software.

[0039] Using the method provided by this invention, when adding or deleting files is required during the software engineering development process, it is only necessary to adjust the list of files and directories to be filtered as defined in the automatic compilation configuration file generation tool. This allows for the convenient and automatic generation of a new second compilation configuration file required by the software engineering, eliminating the need for manual modification of numerous compilation configuration files, reducing the probability of human error, and improving the efficiency of software updates. Attached Figure Description

[0040] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, obtaining other drawings based on these drawings without creative effort still falls within the scope of the present invention.

[0041] Figure 1 This is a schematic diagram of the main flow of an embodiment of the automatic generation method for compilation configuration files provided by the present invention;

[0042] Figure 2 A schematic diagram of the structure of an embodiment of an automatic compilation configuration file generation device provided by the present invention;

[0043] Figure 3 for Figure 2 A schematic diagram of the structure of the compilation rule file generation unit;

[0044] Figure 4 for Figure 2 A schematic diagram of the structure of the unit that automatically generates the compilation configuration file;

[0045] Figure 5 This is a structural diagram of an electronic device disclosed in an embodiment of this application;

[0046] Figure 6 This is a structural diagram of another electronic device disclosed in an embodiment of this application. Detailed Implementation

[0047] To make the objectives, technical solutions, and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the accompanying drawings.

[0048] like Figure 1 The diagram illustrates the main flow of an embodiment of an automatic compilation configuration file generation method provided by the present invention; in this embodiment, the method includes the following steps:

[0049] Step S10: Separate the files to be compiled and the compilation rules in the software project to generate a first compilation configuration file (Makefile) that only includes the compilation rules. The compilation rules include at least the compilation order of the files to be compiled, the linking rules, and the format of the executable file to be generated.

[0050] Step S10 further includes:

[0051] The second compilation configuration file (.mk file) is loaded into a file variable via a file inclusion directive;

[0052] The dependencies of the files to be compiled are obtained based on the file variables, and the compilation order, linking rules, and format of the executable files to be generated are determined.

[0053] Understandably, a Makefile is used to describe the compilation order and rules for all files in the entire software project. It defines a series of rules to specify which files need to be compiled first, which files need to be compiled later, and which files need to be recompiled.

[0054] In existing configuration files, the files to be compiled are often listed together with the compilation rules; that is, the Makefile contains both the files to be compiled and the compilation rules. Below is a code example of such a configuration file:

[0055] all:start.o vectors_m.o interrupts_m.o crt0.o main.o board_f.outart.o / / List of files required for compilation

[0056] $(LINK)$^$(LIBS)$(LINKFLAGS)-o$@$(LDS) / / Compilation and linking rules

[0057] $(OBJCOPY)-O binary-R.note.gnu.build-id$@.elf$@.bin / / Generates a binary bin file

[0058] The method provided in this invention improves upon the original configuration file by using a first compilation configuration file (Makefile) that only includes compilation rules. Specifically, a variable "C_FILE" is created, and the list of files to be compiled is written to a .mk file. The file list is loaded into the C_FILE variable through file inclusion directives. The dependency of the target all is written as the variable "COBJFILE", and the value of the COBJFILE variable is obtained through the "C_FILE" variable, thus separating the file list into a single .mk file. A specific code example is as follows:

[0059]

[0060] Step S11: Using a pre-written automatic compilation configuration file generation tool, search for files to be compiled under the directory tree where the software project is located; save the found files to be compiled and their corresponding directories as file lists and directory lists respectively in the automatically generated second compilation configuration file (.mk file), wherein the second compilation configuration file is included in the first compilation configuration file (Makefile file) through a file inclusion directive.

[0061] It is understood that, in this embodiment, the pre-written automatic compilation configuration file generation tool is an automatically executed script file that can automatically generate a second compilation configuration file (mk file) containing a list of files to be compiled. It can be developed using any language (such as C, C++, JAVA, RUBY, PYTHON, etc.) and at least defines a list of files and directories to be filtered.

[0062] Step S11 further includes:

[0063] Based on the pre-written compilation configuration file automatic generation tool, determine the list of files and directories that need to be filtered;

[0064] Search all files and directories under the directory tree where the software project is located, filter the file and directory lists as needed, exclude the files and directories that need to be filtered, and obtain the files to be compiled and their corresponding directories.

[0065] The names of the files to be compiled and their corresponding directories are formatted.

[0066] The formatted names of the files to be compiled and their corresponding directories are written into the automatically generated second compilation configuration file (.mk file) as file lists and directory lists, respectively.

[0067] The following is a code example of a compiler configuration file automatic generation tool written in Python, as one embodiment:

[0068]

[0069]

[0070] The code example for the second .mk file obtained after running the tool is as follows:

[0071] C_FILE += $(ROOT) / uart.c #c file list collection

[0072] $(ROOT) / start.c\

[0073] $(ROOT) / crt0.c\

[0074] $(ROOT) / vectors_m.c\

[0075] $(ROOT) / interrupts_m.c\

[0076] $(ROOT) / vsprintf.c\

[0077] $(ROOT) / board_f.c\

[0078] $(ROOT) / main.c\

[0079] INCLUDES += #A collection of directory lists. In this example, there are no second-level directories, so it will be empty.

[0080] It is understandable that the automatic compilation configuration file generation tool is a one-time development. After development is completed, if the files in subsequent projects change, you only need to adjust the list of files and directories to be filtered in the automatic generation tool, and then run the tool again to regenerate a new second compilation configuration file.

[0081] In the next step, a compilation command is executed to compile the first compilation configuration file and generate an executable file in the format defined by the first compilation configuration file. Specifically:

[0082] The compilation process command (e.g., make -f Makefile) is executed to compile the Makefile and generate an executable file (e.g., xloader.bin) in the format determined by the compilation rules file.

[0083] For example, in one instance, the code sample of the generated executable file is shown below:

[0084] ~ / fvp / bos$make -f Makefile

[0085] arm-v7-linux-uclibceabi-gcc-c uart.co uart.o

[0086] arm-v7-linux-uclibceabi-gcc-c start.So start.o

[0087] arm-v7-linux-uclibceabi-gcc-c crt0.So crt0.o

[0088] arm-v7-linux-uclibceabi-gcc-c vectors_m.So vectors_m.o

[0089] arm-v7-linux-uclibceabi-gcc-c interrupts_m.co interrupts_m.o

[0090] arm-v7-linux-uclibceabi-gcc-c vsprintf.co vsprintf.o

[0091] arm-v7-linux-uclibceabi-gcc-c board_f.co board_f.o

[0092] arm-v7-linux-uclibceabi-gcc-c main.co main.o

[0093] arm-v7-linux-uclibceabi-ld-nostdlib-T xloader.lds uart.o start.ocrt0.o vectors_m.o interrupts_m.o vsprintf.o board_f.o main.o-Mapxloader.map-o xloader.elf

[0094] arm-v7-linux-uclibceabi-objcopy-O binary-R.note.gnu.build-idxloader.elf xloader.bin

[0095] It is understandable that by using the method provided by this invention, when adding or deleting files to be compiled in the software engineering of a project, it is not necessary to manually edit all the Makefile files one by one, which greatly improves efficiency and reduces the error rate of human operation. The effect is even more prominent when the project involves hundreds of files.

[0096] In the early stages of a project, the files required for software engineering are prone to change. This method allows for automatic generation of new compilation configuration files by simply adjusting the list of files and directories to be filtered in the pre-written automatic compilation configuration file generation tool. This eliminates excessive manual modifications, improves efficiency, and reduces the probability of human error.

[0097] like Figure 2 The diagram shown illustrates a structural schematic of an embodiment of an automatic compilation configuration file generation device 1 provided by the present invention. (In conjunction with...) Figure 3 and Figure 4 As shown, in this embodiment, the device 1 includes at least:

[0098] The first compilation configuration file generation unit 10 is used to separate the files to be compiled and the compilation rules in the software project and generate a first compilation configuration file that only includes the compilation rules. The compilation rules include at least the compilation order of the files to be compiled, the linking rules, and the format of the executable file to be generated.

[0099] The second compiler configuration file automatic generation unit 11 is used to search for files to be compiled under the directory tree where the software project is located using a pre-written compiler configuration file automatic generation tool; and to save the searched files to be compiled and their corresponding directories in the form of a file list and a directory list in the automatically generated second compiler configuration file, wherein the second compiler configuration file is included in the first compiler configuration file through a file inclusion directive.

[0100] like Figure 3 As shown, in a specific example, the compilation rule file generation unit 10 further includes:

[0101] File variable loading unit 100 is used to load the second compilation configuration file into a file variable through a file inclusion directive;

[0102] The compilation rule determination unit 101 is used to obtain the dependency relationship of the file to be compiled based on the file variable, and to determine the compilation order, linking rules and the format of the executable file to be generated.

[0103] like Figure 4 As shown, in a specific example, the second compilation configuration file automatic generation unit 11 further includes:

[0104] The filtering content determination unit 110 is used to determine the list of files and directories to be filtered based on the pre-written compilation configuration file automatic generation tool.

[0105] The filtering processing unit 111 is used to search all files and directories under the directory tree where the software project is located, and exclude the files and directories that need to be filtered according to the file list and directory list to be filtered, so as to obtain the file to be compiled and the corresponding directory.

[0106] The formatting processing unit 112 is used to format the names of the file to be compiled and the corresponding directory.

[0107] The second compilation configuration file forming unit 113 is used to write the files to be compiled with formatted names and their corresponding directories into the automatically generated second compilation configuration file in the form of a file list and a target list, respectively.

[0108] It further includes a compilation processing unit for executing compilation processing commands to compile the first compilation configuration file and generate an executable file in the format determined by the first compilation configuration file.

[0109] The pre-written compilation configuration file automatic generation tool is an automatically executed script file that can be developed in any language, and at least defines a list of files and directories that need to be filtered.

[0110] For more detailed explanations, please refer to and combine them with the aforementioned points. Figure 1 The description will not be repeated here.

[0111] This application also provides an electronic device, see [link to document]. Figure 5 As shown in the embodiment of this application, an electronic device includes:

[0112] Memory 300 is used to store computer programs;

[0113] The processor 200, when executing the computer program, can implement the steps of the method provided in the above embodiments.

[0114] Specifically, the memory 300 includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores an operating system and computer-readable instructions, and the internal memory provides an environment for the operation of the operating system and computer-readable instructions in the non-volatile storage medium. In some embodiments, the processor 200 may be a central processing unit (CPU), controller, microcontroller, microprocessor, or other data processing chip, providing computing and control capabilities to the electronic device. When executing the computer program stored in the memory 300, it can implement the steps of the method disclosed in any of the foregoing embodiments.

[0115] Based on the above embodiments, as a preferred embodiment, see [link to preferred embodiment]. Figure 6 As shown, the electronic device further includes:

[0116] Input interface 600, connected to processor 200, is used to acquire externally imported computer programs, parameters, and instructions, and saves them to memory 300 under the control of processor 200. Input interface 600 can be connected to an input device to receive parameters or instructions manually entered by the user. This input device can be a touch layer covering the display screen, buttons, a trackball, or a touchpad on the terminal casing, or a keyboard, touchpad, or mouse, etc.

[0117] The display unit 400, connected to the processor 200, is used to display data processed by the processor 200 and to display a visual user interface. The display unit 400 can be an LED display, a liquid crystal display, a touch-screen liquid crystal display, or an OLED (Organic Light-Emitting Diode) touchscreen, etc.

[0118] Network port 500, connected to processor 200, is used for communication with external terminal devices. The communication technology used for this connection can be wired or wireless, such as Mobile High Definition Link (MHL), Universal Serial Bus (USB), High Definition Multimedia Interface (HDMI), Wireless Fidelity (WiFi), Bluetooth, Bluetooth Low Energy, or IEEE 802.11s-based communication technologies.

[0119] Figure 6 Only electronic devices with 200-600 components are shown; those skilled in the art will understand that... Figure 6 The structure shown does not constitute a limitation on the electronic device and may include fewer or more components than shown, or combine certain components, or have different component arrangements.

[0120] This application also provides a computer-readable storage medium, which may include various media capable of storing program code, such as a USB flash drive, a portable hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk. The storage medium stores a computer program, which, when executed by a processor, implements the steps of the method disclosed in any of the foregoing embodiments.

[0121] Implementing the embodiments of the present invention has the following beneficial effects:

[0122] This invention provides a method, apparatus, electronic device, and storage medium for automatically generating build configuration files. By separating the build rules in the Makefile from the build file, a first build configuration file containing only the build rules is generated. A pre-written build configuration file automatic generation tool is used to automatically generate a second build configuration file. At the same time, file inclusion instructions are used to link the first and second build configuration files. This invention can replace the existing solution of generating Makefiles through CMake software.

[0123] Using the method provided by this invention, when adding or deleting files during the software engineering development process, it is only necessary to adjust the list of files and directories to be filtered as defined in the automatic compilation configuration file generation tool. This allows for the convenient and automatic generation of a new second compilation configuration file required by the software engineering, eliminating the need for manual modification of numerous compilation configuration files, reducing the probability of human error, and improving the efficiency of software updates.

[0124] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, apparatus, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0125] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0126] The above description is merely a preferred embodiment of the present invention and should not be construed as limiting the scope of the invention. Therefore, any equivalent variations made in accordance with the claims of the present invention are still within the scope of the present invention.

Claims

1. A method for automatically generating compilation configuration files, characterized in that, The method includes at least the following steps: In software engineering, the files to be compiled and the compilation rules are separated to generate a first compilation configuration file that only includes the compilation rules. The compilation rules include at least the compilation order of the files to be compiled, the linking rules, and the format of the executable file to be generated. Using a pre-written automatic compilation configuration file generation tool, search for files to be compiled in the directory tree where the software project is located; The searched files to be compiled and their corresponding directories are saved as file lists and directory lists respectively in the automatically generated second compilation configuration file. The second compilation configuration file is included in the first compilation configuration file through a file inclusion directive. The step of separating the files to be compiled and the compilation rules in the software engineering and generating a first compilation configuration file that only includes the compilation rules further includes: The second compilation configuration file is loaded into a file variable via a file inclusion directive; The dependencies of the files to be compiled are obtained based on the file variables, and the compilation order, linking rules, and format of the executable files to be generated are determined. The step of using a pre-written compilation configuration file automatic generation tool to search for files to be compiled in the directory tree where the software project is located further includes: Based on the pre-written compilation configuration file automatic generation tool, determine the list of files and directories that need to be filtered; Search all files and directories under the directory tree where the software project is located, filter the file and directory lists as needed, exclude the files and directories that need to be filtered, and obtain the files to be compiled and their corresponding directories. The names of the files to be compiled and their corresponding directories are formatted. The formatted names of the files to be compiled and their corresponding directories are written into the automatically generated second compilation configuration file as file lists and directory lists, respectively.

2. The method as described in claim 1, characterized in that, The pre-written compilation configuration file automatic generation tool is an automatically executed script file, which at least defines a list of files and directories that need to be filtered.

3. An automatic configuration file generation device, characterized in that, The device includes: The first compilation configuration file generation unit is used to separate the files to be compiled and the compilation rules in the software project, and generate a first compilation configuration file that only includes the compilation rules. The compilation rules include at least the compilation order of the files to be compiled, the linking rules, and the format of the executable file to be generated. The second compiler configuration file automatic generation unit is used to search for files to be compiled under the directory tree where the software project is located using a pre-written compiler configuration file automatic generation tool; the searched files to be compiled and their corresponding directories are saved in the automatically generated second compiler configuration file in the form of a file list and a directory list, respectively. The second compiler configuration file is included in the first compiler configuration file through a file inclusion directive. The first compilation configuration file generation unit further includes: The file variable loading unit is used to load the second compilation configuration file into a file variable via a file inclusion directive. The compilation rule determination unit is used to obtain the dependency relationship of the file to be compiled based on the file variables, and to determine the compilation order, linking rules and the format of the executable file to be generated. The second automatic compilation configuration file generation unit further includes: The filtering content determination unit is used to determine the list of files and directories to be filtered based on the pre-written compilation configuration file automatic generation tool. The filtering unit is used to search all files and directories in the directory tree where the software project is located, and exclude the files and directories that need to be filtered from the file and directory list to obtain the file to be compiled and its corresponding directory. The formatting processing unit is used to format the names of the file to be compiled and the corresponding directory. The second compilation configuration file forming unit is used to write the formatted names of the files to be compiled and their corresponding directories into the automatically generated second compilation configuration file in the form of a file list and a directory list.

4. The apparatus as described in claim 3, characterized in that, The pre-written compilation configuration file automatic generation tool is an automatically executed script file, which at least defines a list of files and directories that need to be filtered.

5. An electronic device comprising a memory and a processor, wherein the memory and the processor are communicatively connected, and the memory stores computer instructions, characterized in that, The processor executes the computer instructions to perform the automatic generation method of the compilation configuration file as described in any one of claims 1 to 2.

6. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions for causing a computer to execute the automatic generation method of the compilation configuration file as described in any one of claims 1 to 2.