User Tools

Site Tools


programming

This is an old revision of the document!


Table of Contents

Programming

C

  • GCC_EXEC_PREFIX . For defining the GCC executables prefix

Makefiles

  • Targets without prerequisites are called phony targets (clean target)
  • Is standard practice to have an OBJS(or objects) variable to list all the object files.
  • There is an implicit rule to make .o files out of .c files: example.o: example.h
  • If you have several target depending of the same (not .c) prerequisites you can do: kbd.o command.o files.o : command.h
  • A good clean rule. .PHONY tell explicitly that clean is a phony target (in case there is a file called “clean” in the directory). With -rm execution continues even with errors coming out of rm. Ex:
.PHONY : clean
clean :
           -rm edit $(objects)
  • Variables are used with $()
  • “-” in front of a directive appears to ignore errors.
  • MAKEFILES is an environmental variable that tells make to include the makefiles listed there if they exist. Used in recursive invocations of make.
  • It seems that Double-colon rules (::) are always executed (updated)
  • make -n target will print the commands to update target without executing them.
  • $? only files that have change.
programming.1245207221.txt.gz · Last modified: 2021/02/01 05:55 (external edit)