A tool used to assist in compiling and lining C code. makefiles are defined in:
makefileMakefileGNUmakefile
Example
CC = gcc
CCFLAGS = -I$(GSL_INC) -O2
LDFLAGS = -L$(GSL_LIB)
all: hellow
hellow: hellow.c
$(CC) $(CCFLAGS) $(LDFLAGS) $@ $^
.PHONY: clean // not a file, but a command
clean:
rm -f hellow *.o
%.o: %.c sorts.h
gcc -c $< -o $@
// wildcard .o, wildcard .c, $@ name of target, $<, name of first argumentHas commands:
make allmake hellowmake clean
Concepts
- Make Variable
- Make Suffix Rules
- Make Pattern Rules
- Make Target
- Make PHONY Target
- Make Dependency Graph