Skip to content

Instantly share code, notes, and snippets.

@xivSolutions
Created July 5, 2014 23:46
Show Gist options
  • Save xivSolutions/a15ad3db384f2b1bcbff to your computer and use it in GitHub Desktop.
Save xivSolutions/a15ad3db384f2b1bcbff to your computer and use it in GitHub Desktop.
Makefile for Harvard cs50 course excercises
# Hacked-together make file for use with Harvard cs50 on-line course excercises
# Type terminal commands as follows: make EXE=yourFileName (don't add extensions)
# the compiler: gcc for C program, define as g++ for C+ use clang for Harvard stuff
CC = clang
# compiler flags:
# -g adds debugging information to the executable file
# -Wall turns on most, but not all, compiler warnings
CFLAGS = -g -Wall
# link THIS for the cs50 functions (add others as needed):
LFLAGS = -lcs50
# the build target executable:
TARGET = $(EXE)
all: $(TARGET)
$(TARGET): $(TARGET).c ; $(CC) $(CFLAGS) -o $(TARGET) $(TARGET).c $(LFLAGS)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment