Skip to content
Snippets Groups Projects
Makefile.proxy 694 B
Newer Older
  • Learn to ignore specific revisions
  • toole1's avatar
    toole1 committed
    CC = g++
    
    toole1's avatar
    toole1 committed
    CFLAGS += -Wall -Wshadow
    
    toole1's avatar
    toole1 committed
    TESTEXE := proxy
    # This order is necessary for security. Always include student code last!
    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
    
    $(TESTEXE): $(TESTOBJS)
    
    toole1's avatar
    toole1 committed
    	$(CC) $(TESTOBJS) -lrt -o $@
    
    toole1's avatar
    toole1 committed
    %.o : %.cpp $(wildcard *.h)
    
    toole1's avatar
    toole1 committed
    	$(CC) $(CFLAGS) -c $(@:.o=.cpp) -o $@
    
    ifndef CLEAN_TARGET
    CLEAN_TARGET = clean
    .PHONY: clean
    clean:
    	-rm -f *.o $(TESTEXE)
    endif