Created
October 16, 2013 07:30
-
-
Save obstschale/7003963 to your computer and use it in GitHub Desktop.
Template: Simple makefile for compiling C programs using gcc
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
# CC is the compiler which will be used | |
CC=gcc | |
# CFLAGS are the options I'll pass to the compiler | |
CFLAGS=-c -Wall | |
all: hello | |
hello: main.o factorial.o hello.o | |
$(CC) main.o factorial.o hello.o -o hello | |
main.o: main.cpp | |
$(CC) $(CFLAGS) main.cpp | |
factorial.o: factorial.cpp | |
$(CC) $(CFLAGS) factorial.cpp | |
hello.o: hello.cpp | |
$(CC) $(CFLAGS) hello.cpp | |
clean: | |
rm -rf *o hello |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment