110 likes | 236 Vues
This comprehensive guide provides an overview of the essential tools and processes for C programming application development. Learn how to utilize text editors, compile source files with GCC, manage dependencies through Makefiles, and control versions using RCS. Topics include syntax-aware and directed editors, preprocessor directives, symbolic constants, and conditional compilation practices. The document covers key commands for compilation, linking executables, as well as best practices for organizing your development project and using source control effectively.
E N D
Preparing Source Files A.c B.c B.h Editor • Text editors (e.g., Notepad) • “syntax aware” editors (e.g., emacs) • “syntax directed” editors (e.g., VisualStudio)
Compiling $> gcc A.c B.c –o myApp.exe A.c B.c B.h “gcc” Preprocessor Compile Link • Symbolic constants: #define MAXLEN 256 • .h file control: #ifndef B_H • Conditional compilation: #ifdef _DEBUG • “Other”: #define IS_DYNAMIC(x) ….
Compiling $> gcc A.c B.c –o myApp.exe A.c B.c B.h “gcc” Preprocessor Compile Link
printf() scan() Compiling $> gcc A.c B.c –o myApp.exe A.c B.c B.h “gcc” Preprocessor Compile Link myApp.exe
Compiling /lib/libc.a $> gcc A.c B.c –o myApp.exe printf() scan() A.c B.c B.h “gcc” Preprocessor Compile Link myApp.exe
Compiling $> gcc –c A.c B.c $> gcc A.o B.o –o myApp.exe /lib/libc.a A.c B.c B.h printf() scan() Preprocessor Compile A.o Link myApp.exe B.o
Build: make $> make A.c B.c B.h make Makefile myApp.exe gcc –c A.c gcc –c B.c gcc A.o B.o –o myApp.exe
A.c B.c B.h Repository(Another directory) Makefile Test data Development Process / Tools The “Project” Tools Editor A.c B.c B.h WorkingDirectory cpp/gcc Makefile Test data Make checkin checkout Source Control
RCS myProj/ • ci file • ci –u file • ci –l file • co file • co –l file • rcsdiff file • rlog file A.c B.c B.h Makefile Test data RCS/ A.c B.c B.h Makefile Test data
A.c B.c B.h Makefile Test data A.c B.c B.h Makefile Test data Team Development Using RCS myProj/ hisProj/ A.c B.c B.h Makefile Test data RCS/ RCS/ (mkdir RCS) (ln –s ~tom/myProj/RCS RCS)