Easy Coding
  Forum Wiki Tagging Projekte Karte RSS
» Start
» All Recent Changes
» Wiki Suche
» Wiki Hilfe

Informationen

How To's Algorithmen

edit SideBar

Neue Wiki Eintrage finden Sie unter easy-coding.de/wiki.

Makefile

Beispiel

Ein Programm foo soll im 90er ANSI C Standard erzeugt werden. Außerdem wird eine Testmethode zur Verfügung gestellt.

Makefile
  1. CC=gcc
  2. CCFLAGS= -Wall -g -ansi
  3. LD=gcc
  4. PROG=foo
  5. SRC=foo.c
  6.  
  7. all: $(PROGS)
  8.  
  9. include make.depend
  10.  
  11. foo: foo.o
  12.         $(LD) $(CCFLAGS) foo.o -o list
  13.  
  14. depend:
  15.         $(CC) -MM $(SRC) > make.depend
  16.  
  17. test: $(PROGS)
  18.         ./foo
  19.  
  20. clean:
  21.         -/bin/rm *.o $(PROGS)
  22.  
  23. .SUFFIXES: .o .c .h
  24.  
  25. %.o : %.c
  26.         $(CC) -c $(CCFLAGS) $< -o $@
  27.  
  28. %.o : %.c %.h
  29.         $(CC) -c $(CCFLAGS) $< -o $@
Zuletzt geändert am 11.11.2006 12:23 Uhr
  Impressum