Problems 12
  1. Theory.
    1. How can you find out the GNU-make built-in recipe to compile and link a single '.c' file into an executable code?
      Hint:
      make -p | fgrep -A2 '%: %.c'
      
      or, more precisely,
      make -p 2> /dev/null | grep -A2 '%: %\.c$'
      
      and then
      make -p | fgrep 'LINK.c ='
      
      (In the make language a pattern rule in the form, say, '%.o: %.c' says how to make any file stem.o from another file stem.c).
    2. How can you find out the GNU make built-in recipe to compile a '.c' source file into a '.o' object code file?
    3. How can you find out the GNU make built-in recipe to link '.o' object code files into an executable file?
    4. How can you find out the meaning of the GNU make automatic variables '$@', '$^', '$<' etc.?
      Hint:
      Google the emphasized phrase ;).
  2. Practice.
    1. In the previous exercise:
      • Split your main.c file into two: one containing the errorfc function and another one containing the main function; do the necessary modifications in the makefile.
      • Format the figure(s) using the figure environment; use caption and label.
      • Include citations using the embedded thebibliography environment.
      • Rewrite the defenition of the error function as a differential equation with initial boundary condition; implement a function which calculates the error function by solving numerically this differential equation.
        Hint:
        dy/dx = 2/√π e-x², y(0)=0.
      • Compare the number of calls correspondingly to the integrand and the right-hand-side function done by the qagiu routine and your favourite ODE routine (rkf45, for instance).