Skip to content

Instantly share code, notes, and snippets.

@a60814billy
Created September 19, 2013 13:20
Show Gist options
  • Save a60814billy/6623363 to your computer and use it in GitHub Desktop.
Save a60814billy/6623363 to your computer and use it in GitHub Desktop.
100590309 HW7 makefile
#makefile for 100590309 OOP HW 7
UNITLITEDIR = ./CppUnitLite
UNITHEADER = $(wildcard $(UNITLITEDIR)/*.h)
UNITCPP = $(wildcard $(UNITLITEDIR)/*.cpp)
UNITOBJ = $(subst .cpp,.o,$(UNITCPP))
HEADER = $(wildcard *.h)
CPP = $(wildcard *.cpp)
OBJ = $(subst .cpp,.o,$(CPP))
LIB = -lCppUnitLite
LIBDIR = -L $(UNITLITEDIR)/
INCLUDEDIR = -I $(UNITLITEDIR) -I ./
CXX = g++
CXXFLAGS = -O2 -w $(INCLUDEDIR)
PROGRAM = hw7
.PHONY:all clean cleanObj
all:$(PROGRAM)
$(PROGRAM):cppunitlite $(OBJ)
$(CXX) $(CXXFLAG) -o $(PROGRAM) $(OBJ) $(LIBDIR) $(LIB)
$(OBJ):$(CPP) $(HEADER)
cppunitlite:$(UNITOBJ)
ar -r $(UNITLITEDIR)/libCppUnitLite.so $(UNITOBJ)
$(UNITOBJ):$(UNITCPP) $(UNITHEADER)
cleanObj:
rm -f $(UNITLITEDIR)/*.o *.o
clean:
rm -f $(UNITLITEDIR)/*.o $(UNITLITEDIR)/*.so *.o *.gch $(PROGRAM)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment