Skip to content

Instantly share code, notes, and snippets.

@captainGeech42
Last active February 5, 2018 01:25
Show Gist options
  • Save captainGeech42/230af8dde9eb98d4ab3cfa4e9da48130 to your computer and use it in GitHub Desktop.
Save captainGeech42/230af8dde9eb98d4ab3cfa4e9da48130 to your computer and use it in GitHub Desktop.
CS161 Makefile
CC = g++
C_FLAGS = -g -Wall
ifndef num
$(error num is not set. Please re-run make with the argument `num=#`, where # is the assignment #)
endif
ifndef header
all:
$(CC) $(C_FLAGS) -o assignment$(num) assignment$(num).cpp
else
all:
$(CC) $(C_FLAGS) -o assignment$(num) assignment$(num).cpp assignment$(num)_func.cpp
endif
clean: assignment$(num)
$(RM) assignment$(num)
run: assignment$(num)
./assignment$(num)
debug: assignment$(num)
gdb assignment$(num)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment