Advertisement
milanmetal

[Make] MSREAL Hello Make

Oct 23rd, 2018
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Make 0.43 KB | None | 0 0
  1. sources=$(wildcard *.c)
  2. objekti=$(sources:.c=.o)
  3. EXEC = calculate
  4.  
  5. # sve posle dve tacke se zove DEPENDENCY
  6. all:$(EXEC)
  7. $(EXEC) : $(objekti)
  8.     gcc -o $@ $(objekti)
  9. calculate.o : calculate.c helper.h
  10.     gcc -c calculate.c # ovde ne navodim .h fajlove, sami se includuju
  11. helper.o : helper.c helper.h
  12.     gcc -c helper.c
  13.  
  14. .PHONY : clean
  15. clean:
  16. # If ther is a file - remove it, otherwise do nothing (-f)
  17.     rm -f $(objekti) $(EXEC)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement