Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Compiler specific
- CC=gcc
- CCDEP=gcc
- EXECUTABLE=dhci
- CFLAGS=-g3 -std=c99 -Wall -pedantic -O2 -Q
- SRCFILE= main.c \
- dhci_core/src/action_hdl.c \
- dhci_core/src/addr_trans.c
- OBJDIR=
- INCDIRS=-I.\
- -Itools/inc/ \
- -Idhci_core/inc/
- #Source Directories - all sources in the specified directory will be compiled
- SRCDIR= $(wildcard tools/src/*.c)
- #$(wildcard dhci_core/src/*.c) \
- #$(wildcard dhci_system/src/*.c)
- ########################################################################################
- #Doxygen configuration
- DOXYFILEPATH=doc/Doxyfile
- ########################################################################################
- #dont edit lines below this comment (autmating the object build and the dependencies)
- SOURCES=$(SRCDIR) $(SRCFILE)
- OBJECTS=$(notdir $(SOURCES:.c=.o))
- #creating objectfiles...
- %.o:
- gcc $(CFLAGS) -c $(<:.o=.c)
- #build the C-Flags (for a better readability below)
- CFLAGS:=$(CFLAGS) $(INCDIRS)
- #make dependencies of every file
- depend: .depend
- #compile depencies and save it in .depend after that it will be included and the objects could be build!!
- .depend: $(SOURCES)
- $(CCDEP) $(CFLAGS) -MM $^ > .depend || rm -f .depend
- include .depend
- #defines %make all
- .PHONY: all
- all: $(EXECUTABLE)
- #removes object files %make clean
- .PHONY : clean
- clean :
- -rm -f $(EXECUTABLE) $(OBJDIR)/*.o .depend
- .PHONY: doc
- doc:
- doxygen $(DOXYFILEPATH)
- .PHONY: run
- push:
- mv *.o $(OBJDIR)
- pop:
- -mv $(OBJDIR)/*.o .
- #builds the executable
- $(EXECUTABLE): .depend $(OBJECTS)
- $(CC) -o $(EXECUTABLE) $(OBJECTS)
- size $(EXECUTABLE)
Add Comment
Please, Sign In to add comment