A kind of efficient generation can the method and system of software package executable
Technical field
The present invention relates to the multi-level bibliographic structure field of multifile under linux system, being specifically related to a kind of efficient generation can the method and system of software package executable.
Background technology
At present, under linux system under the multi-level bibliographic structure of multifile, general need artificial software source codes are compiled generation can software package executable, there is following defect:
(1) not only work efficiency is lower in manual operation, and easily occurs misoperation, and job schedule is lower.
(2) what at present compiling generated the method for software package executable can only correspond to the board of a type, and the scope of application is more single, is not easy to transplant.
Summary of the invention
For the defect existed in prior art, the object of the present invention is to provide a kind of efficient generation can the method and system of software package executable, the present invention effectively can reduce that generate can time needed for software package executable, increasing work efficiency, without the need to carrying out manual operations, not easily occurring misoperation, not only while saving human resources, improve operating accuracy, and dissimilar board can be supported, the scope of application is relatively more extensive, convenient transplanting.
For reaching above object, efficient generation provided by the invention can the method for software package executable, comprises the following steps:
S1: all operations information needed for board that combing integrated needs use, according to operation information in Shell script file, generates executable file by the compiling of make instrument, forwards step S2 to;
S2: input needs the board name of the board used as parameter value in Shell script file, grand accordingly according to the definition of board name in Shell script file, the corresponding grand difference of different board name; Shell script file is according to performing executable file, forwarding step S3 to grand;
S3: the operating file of all executable files, all executable files needs and the software and hardware Information Compression packing of board are formed final software package executable.
On the basis of technique scheme, step S1 specifically comprises the following steps:
S101: the compiling information that in data board card software source code, all module compiles need, forwards step S102 to;
S102: according to the logical relation of modules all in source code, carries out combing compiling sequence to module used, forwards step S103 to;
S103: write Shell script file, performs the compiler task of each module successively in Shell script file according to the order of sequence, form executable file.
On the basis of technique scheme, compile described in step S101 the subcommand of all modules in packets of information rubbing board card software source code, the position of son file and and son file executive mode; Compiler task described in step S103 comprises compiling subcommand and compiling son file.
On the basis of technique scheme, in Shell script file, perform the compiler task of each module successively according to the order of sequence described in step S103, specifically comprise the following steps: after Shell script file often performs the compiler task of a module, the process record file generated by current compiler task redirects to temporary file temp; After all process record files redirect to temp, from temp, screening zone has the process record file of keyword to final process record file.
On the basis of technique scheme, the keyword in step S103 is " Error " and " Warning ".
On the basis of technique scheme, when performing compiler task in step S103, if there is mistake, according to the wrong rreturn value misprint log file of Shell script file, compulsory withdrawal, terminates.
On the basis of technique scheme, step S3 specifically comprises the following steps: for each board sets up corresponding configuration file, records the software and hardware information of board in configuration file; All executable files, the operating file of all executable files needs and the software and hardware information of board is compressed by tool of compression; Read the information of the configuration file of each board, generate and support that specified panel card carries out the boot files of online upgrading.
On the basis of technique scheme, operating file described in step S3 comprises dynamic base, public library and platform file.
On the basis of technique scheme, the reel number of the software and hardware packets of information rubbing board card of board described in step S3, plate number, software version number and Starting mode.
The efficient generation realizing said method provided by the invention can the system of software package executable, comprises executable file generation module, executable file execution module and software package executable generation module;
Described executable file generation module is used for: all operations information needed for board that combing integrated needs use, according to operation information in Shell script file, generate executable file by the compiling of make instrument, send executive signal to executable file execution module;
Described executable file execution module is used for: after receiving executive signal, in Shell script file, input needs the board name of the board used as parameter value, grand accordingly according to the definition of board name in Shell script file, the corresponding grand difference of different board name; Shell script file is according to performing executable file with grand, sends generate signal to software package executable generation module;
Described software package executable generation module is used for: the software and hardware Information Compression packing of the operating file of all executable files, all executable file needs and board is formed final software package executable.
Compared with prior art, the invention has the advantages that:
(1) Shell script of the present invention can (compress compressed file and BMU public library etc. further in the compiling (generation executable file) of one-key operation source code, compression (compressing the file of dynamic base comprised needed for this executable file and link) and packing, final generation can be used for the final software package of online upgrading), effectively can not only reduce that generate can time needed for software package executable, increase work efficiency, and without the need to carrying out manual operations, not easily there is misoperation, while saving human resources, improve operating accuracy.
(2) the present invention is provided with the parameter value representing board name in Shell script file, the readability of Shell script is comparatively strong, can pass through the parameter value of simple modification, increase or deleted representation board name, and then support dissimilar board, the scope of application is relatively more extensive, convenient transplanting.
(3) the present invention all can independently exist in compiling, compression and packing, and level is relatively clearly more demarcated, is convenient to exploitation and safeguards.
Embodiment
Below in conjunction with embodiment, the present invention is described in further detail.
Efficient generation in the embodiment of the present invention can the method for software package executable, gets based on following software:
Make instrument: a very important compiler directive.Because source code has resolved into multiple module being easy to manage by bibliographic structure, each module comprises hundreds of and arrives thousands of source files, utilizes make and makefile instrument can make the mutual relationship of numerous and complicated between each source file in module brevity and lucidity in order and compile.
Shell script: a kind of user of providing uses the software (command analysis device) at interface, is good at system management tasks especially, can makes a large amount of task automations, be particularly useful for ease for use, maintainable, the prior task of portability specific efficiency.
Efficient generation in the embodiment of the present invention can the method for software package executable, comprises the following steps:
S1: all operations information needed for board that combing integrated needs use, according to operation information in Shell script file, generates executable file by the compiling of make instrument, forwards step S2 to.
S2: input needs the board name of the board used as parameter value in Shell script file, grand accordingly according to the definition of board name in Shell script file.The corresponding grand difference of different board names.Shell script file is according to performing executable file, forwarding step S3 to grand.
S3: the operating file of all executable files, all executable files needs and the software and hardware Information Compression packing of board are formed final software package executable.
Step S1 specifically comprises the following steps:
S101: the compiling information that in data board card software source code, all module compiles need, forwards step S102 to.
S102: according to the logical relation of modules all in source code, carries out combing compiling sequence to module used, forwards step S103 to.
S103: write Shell script file, performs the compiler task of each module successively in Shell script file according to the order of sequence, form executable file.
The subcommand of all modules, the position of son file and and son file executive mode in compiling packets of information rubbing board card software source code in step S101.
Compiler task in step S103 comprises compiling subcommand and compiling son file.
In Shell script file, perform the compiler task of each module successively according to the order of sequence in step S103, specifically comprise the following steps: after Shell script file often performs the compiler task of a module, the process record file generated by current compiler task redirects to temp (temporary file), after all process record files redirect to temp, from temp, screening zone has the process record file of keyword to final process record file.
Keyword in step S103 is " Error " and " Warning ".
When performing compiler task in step S103, if there is mistake, according to the wrong rreturn value misprint log file of Shell script file, compulsory withdrawal, terminates.
Step S3 specifically comprises the following steps:
For each board sets up corresponding configuration file, in configuration file, record the software and hardware information of board.All executable files, the operating file of all executable files needs and the software and hardware information of board is compressed by tool of compression; Read the information of the configuration file of each board, generate and support that specified panel card carries out the boot files of online upgrading, and then make the online upgrade function of software package support.
Operating file in step S3 comprises dynamic base, public library and platform file; The reel number of the software and hardware packets of information rubbing board card of board in step S3, plate number, software version number and Starting mode.
The efficient generation realizing said method in the embodiment of the present invention can the system of software package executable, comprises executable file generation module, executable file execution module and software package executable generation module.
Executable file generation module is used for: all operations information needed for board that combing integrated needs use, according to operation information in Shell script file, generate executable file by the compiling of make instrument, send executive signal to executable file execution module.
Executable file execution module is used for: after receiving executive signal, and in Shell script file, input needs the board name of the board used as parameter value, grand accordingly according to the definition of board name in Shell script file, the corresponding grand difference of different board name; Shell script file is according to performing executable file with grand, sends generate signal to software package executable generation module.
Software package executable generation module is used for: the software and hardware Information Compression packing of the operating file of all executable files, all executable file needs and board is formed final software package executable.
The present invention is not limited to above-mentioned embodiment, and for those skilled in the art, under the premise without departing from the principles of the invention, can also make some improvements and modifications, these improvements and modifications are also considered as within protection scope of the present invention.The content be not described in detail in this instructions belongs to the known prior art of professional and technical personnel in the field.