Compilation and Makefiles (ITI8510)

Allikas: Lambda
Real-Time Operating Systems and Systems Programming
[ @ ]

Here we want to be on the same page regarding some compilation topics.

Task

  1. Create a program which consists of multiple files, each containing a single function. Functions would be as follows: main(), func1() and func2(). Main should call these functions. Also add the header files for func1 and func2.
  2. Compile the program, run it.
  3. Show how the preprocessor affects the compilation of main.c (save the file)
  4. Show the assembly code of main.c (save the file before translation to the machine code).
  5. Create a makefile for the compilation.
  6. Modify the makefile so that you compile .o files, then link them together into a working program.