Guest User

Untitled

a guest
Oct 17th, 2018
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Make 1.56 KB | None | 0 0
  1. # Compiler specific
  2. CC=gcc
  3. CCDEP=gcc
  4. EXECUTABLE=dhci
  5. CFLAGS=-g3 -std=c99 -Wall -pedantic -O2  -Q
  6. SRCFILE= main.c \
  7.     dhci_core/src/action_hdl.c \
  8.     dhci_core/src/addr_trans.c
  9. OBJDIR=
  10. INCDIRS=-I.\
  11.     -Itools/inc/ \
  12.     -Idhci_core/inc/
  13. #Source Directories - all sources in the specified directory will be compiled
  14. SRCDIR= $(wildcard tools/src/*.c)
  15. #$(wildcard dhci_core/src/*.c) \
  16. #$(wildcard dhci_system/src/*.c)
  17. ########################################################################################
  18. #Doxygen configuration
  19. DOXYFILEPATH=doc/Doxyfile
  20. ########################################################################################
  21. #dont edit lines below this comment (autmating the object build and the dependencies)
  22. SOURCES=$(SRCDIR) $(SRCFILE)
  23. OBJECTS=$(notdir $(SOURCES:.c=.o))
  24.  
  25. #creating objectfiles...
  26. %.o:
  27.     gcc $(CFLAGS) -c $(<:.o=.c)
  28. #build the C-Flags (for a better readability below)
  29. CFLAGS:=$(CFLAGS) $(INCDIRS)
  30.  
  31. #make dependencies of every file
  32. depend: .depend
  33. #compile depencies and save it in .depend after that it will be included and the objects could be build!!
  34. .depend: $(SOURCES)
  35.     $(CCDEP) $(CFLAGS) -MM  $^ > .depend || rm -f .depend
  36.  
  37. include .depend
  38.  
  39.  
  40. #defines %make all
  41. .PHONY: all
  42. all: $(EXECUTABLE)
  43. #removes object files %make clean
  44. .PHONY : clean
  45. clean :
  46.     -rm -f $(EXECUTABLE) $(OBJDIR)/*.o .depend
  47. .PHONY: doc
  48. doc:
  49.     doxygen $(DOXYFILEPATH)
  50. .PHONY: run
  51.  
  52. push:
  53.     mv *.o $(OBJDIR)
  54. pop:
  55.     -mv $(OBJDIR)/*.o .
  56. #builds the executable
  57. $(EXECUTABLE): .depend $(OBJECTS)
  58.     $(CC)  -o $(EXECUTABLE) $(OBJECTS)
  59.     size $(EXECUTABLE)
Add Comment
Please, Sign In to add comment