Created
January 14, 2011 18:43
-
-
Save fbs/780025 to your computer and use it in GitHub Desktop.
A simple 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
# TOOLS | |
CPP = g++ | |
CC = gcc | |
# MORE TOOLS | |
SIZE = size | |
OBJCOPY = objcopy | |
OBJDUMP = objdump | |
#PROJECT RELATED STUFF | |
NAME = todo-list | |
#FLAGS | |
CFLAGS = -Wall | |
#LDFLAGS = | |
#DEBUG FLAGS | |
DFLAGS = -ggdb | |
#PROJECT FILES | |
CSRC = src/fileio.c src/main.c src/search.c src/todo.c | |
#CPPSRC | |
#ASMSRC | |
#OBJECT FILES | |
OBJ = $(CSRC:.c=.o) | |
#STUFF TO CLEAN | |
CLEAN += $(OBJ) | |
.PHONY: all release clean size debug | |
all: debug size | |
clean: | |
rm -rf $(CLEAN) | |
debug: $(OBJ) | |
$(CC) $(DFLAGS) $(CFLAGS) $(LDFLAGS) -o debug/$(NAME) $(OBJ) | |
release: $(OBJ) | |
$(CC) $(CFLAGS) $(LDFLAGS) -o release/$(NAME) $(OBJ) | |
size: debug #need to fix this, should also work with build | |
$(SIZE) debug/$(NAME) | |
$(COBJ): %.o : %.c | |
$(CC) $(CFLAGS) -c -o build/$@ $< | |
#compile into build directory |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment