Created
February 7, 2017 19:41
-
-
Save kluzny/c1adc44aecdb78798f489fe082abdca0 to your computer and use it in GitHub Desktop.
cs50 basic makefile using gcc on ubuntu
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 = /usr/bin/gcc | |
CFLAGS = -g -Wall | |
LFLAGS = -lcs50 | |
BIN = hello | |
all: $(BIN) | |
$(BIN): | |
$(CC) $(CFLAGS) -o $(BIN) $(BIN).c $(LFLAGS) | |
clean: | |
rm -rfv $(BIN) | |
run: | |
./$(BIN) | |
# example usage | |
# ॐ ~/development/c/helloworld ☠ make | |
# /usr/bin/gcc -g -Wall -o hello hello.c -lcs50 | |
# ॐ ~/development/c/helloworld ☠ make run | |
# ./hello | |
# asdf | |
# hello, asdf | |
# ॐ ~/development/c/helloworld ☠ make clean | |
# rm -rfv hello | |
# removed 'hello' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment