Created
September 24, 2013 15:29
-
-
Save danrl/6686497 to your computer and use it in GitHub Desktop.
a very generic makefile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# build config | |
TARGETS = bin1 bin2 | |
INCLUDES = header.h | |
# project config | |
CC = gcc | |
CFLAGS += -Wall -Wextra -pedantic | |
LDFLAGS += | |
# generic build instructions | |
.PHONY: all clean | |
.DEFAULT: all | |
all: $(TARGETS) | |
${TARGETS}: %: %.o $(INCLUDES) | |
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< | |
.c.o: $(INCLUDES) | |
$(CC) $(CFLAGS) -c $< | |
clean: | |
rm -rf $(TARGETS) | |
rm -rf $(TARGETS:=.o) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment