Newer
Older
WARNINGS := -Wchar-subscripts -Wparentheses -Wreturn-type -Wmissing-braces -Wundef -Wshadow
CFLAGS += $(WARNINGS)
TESTEXE := proxy
# This order is necessary for security. Always include student code last!
# TODO (toole1): I wish I knew why this was; doing unit_tests first is slow if the student code doesn't compile
TESTOBJS := $(TESTEXE).o util.o unit_tests.o monad_shared.o $(TESTOBJS)
OPTIMIZE := off
ifeq ($(strip $(OPTIMIZE)),on)
CFLAGS += -O2 -DOPTIMIZE
else ifeq ($(strip $(OPTIMIZE)),off)
CFLAGS += -g -O0
else
$(warning Invalid value specified for OPTIMIZE. Should be on or off)
CFLAGS += -g -O0
endif
ifndef ALL_TARGET
ALL_TARGET = all
all: $(TESTEXE)
endif
LIBS:=
IS_LIBRT:=$(shell echo "int main(){}" | g++ -o /dev/null -x c++ - -lrt &>/dev/null ; echo $$?)
IS_LIBPNG:=$(shell echo "int main(){}" | g++ -o /dev/null -x c++ - -lpng &>/dev/null ; echo $$?)
unit_tests.o : unit_tests.cpp $(wildcard *.h)
../ccmonad $(CC) $(CFLAGS) -c $(@:.o=.cpp) -o $@