TAILIEUCHUNG - Programming Linux Games phần 2

Tham khảo tài liệu 'programming linux games phần 2', công nghệ thông tin, kỹ thuật lập trình phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | 24 CHAPTER 2 Using the Make Utility Most game development projects consist of multiple source files for the simple reason that it is impractical to manage thousands of lines of code in a single file. Since a large project can involve many source files it would be wasteful to recompile everything if only one file had been changed since the program was last compiled. This happens however if all of the files are given to gcc at once on the command line. For instance the Linux version of Civilization Call To Power consists of more than 500 000 lines of C code in well over 100 files and a full recompile of the entire source tree takes nearly an hour whereas a partial rebuild assisted by Make usually takes 15 to 20 minutes . The Make utility speeds up software development by automatically determining which files actually need to be recompiled after changes have been made. Make also eliminates the need to type long command lines to rebuild programs since it stores all of the required commands and invokes them as needed. Although Make has a lot of functionality its basic usage is quite simple. It is based on targets which are sets of directions for maintaining the components object files libraries and so on of a program. Targets specify the name of the component to track the source files and other targets that the component depends on and the commands for rebuilding the target. The instructions for building a component are called rules and the list of files that a component depends on are called dependencies. When make is invoked upon a certain target it checks that target s dependency list first. If any of the dependencies have been changed since the target was last rebuilt the target s rules are executed. Make also recursively rebuilds any out-of-date targets in the dependency list. This is extremely convenient for large modular programming projects. Creating Makefiles Make looks for targets and rules in a file called Makefile or makefile. This file can contain any .

Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.