Created
February 1, 2015 17:45
-
-
Save woodbridge/7e09aea12dc461edd688 to your computer and use it in GitHub Desktop.
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
# This Makefile should be used as a template for future Makefiles. | |
# It’s heavily commented, so hopefully you can understand what each | |
# line does. | |
# We’ll use gcc for C compilation and g++ for C++ compilation | |
CC = gcc | |
CXX = g++ | |
# Let’s leave a place holder for additional include directories | |
INCLUDES = | |
# Compilation options: | |
# -g for debugging info and -Wall enables all warnings | |
CFLAGS = -g -Wall $(INCLUDES) | |
CXXFLAGS = -g -Wall $(INCLUDES) | |
# Linking options: | |
# -g for debugging info | |
LDFLAGS = -g | |
# List the libraries you need to link with in LDLIBS | |
# For example, use "-lm" for the math library | |
LDLIBS = | |
convert: main.o | |
main.o: main.c | |
printf-test: printf-test.o | |
printf-test.o: printf-test.c | |
.PHONY: clean | |
clean: | |
rm -f *.o a.out core main | |
# "all" target is useful if your Makefile builds multiple programs. | |
# Here we’ll have it first do "clean", and rebuild the main target. | |
.PHONY: all | |
all: clean main |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment