How to Make a GNU Documentation Compilation Target

If you distribute your GNU/Linux programs as source code, you should include a makefile so that users across distributions can install your program. The makefile tells the operating system what to do with the individual components that make up your program. As part of the file, you need to document the target components and write the prerequisites and rules needed to make the program. Use a standard formula for specifying targets.

Instructions

    • 1

      Open your makefile.

    • 2

      Type the following formula to specify your make:

      target : prerequisites
      recipe

      Target is the source code file to make. Replace "prerequisites" are the libraries the the target file depends on. "Recipe" is the command the OS should use. The final product might look like this:

      test.o : lib1.c lib2.c
      cc -c test.o

      Repeat this step for each target.

    • 3

      Save and close your makefile.

Related Searches:

References

Comments

Related Ads

Featured