72 lines
1.6 KiB
Makefile
72 lines
1.6 KiB
Makefile
CC = g++
|
|
CCLINK = g++
|
|
LIBS =
|
|
CCOPTIONS = -Wall -pedantic -g
|
|
LDOPTIONS =
|
|
HDRS = customer_list.h test_customer_list.h
|
|
|
|
TEST = customer_list
|
|
|
|
TESTOBJECT = customer_list_test_driver.o
|
|
OBJS = customer_list.o test_customer_list.o shortcut.o
|
|
|
|
DOXY = doxygen
|
|
|
|
all: $(PROGRAM)
|
|
./$(PROGRAM)
|
|
|
|
$(TEST): $(OBJS) $(TESTOBJECT)
|
|
$(CCLINK) -o $@ $(LDOPTIONS) $(OBJS) $(TESTOBJECT)
|
|
|
|
$(PROGRAM): $(OBJS) $(MAINOBJECT)
|
|
$(CCLINK) -o $@ $(LDOPTIONS) $(OBJS) $(MAINOBJECT)
|
|
|
|
.PHONY: clean cleanall doxy test
|
|
|
|
clean:
|
|
rm -f $(PROGRAM) $(TEST) $(TESTOBJECT) $(MAINOBJECT) $(OBJS)
|
|
|
|
cleanall:
|
|
rm -f $(PROGRAM) $(TEST) $(OBJS) $(TESTOBJECT) $(MAINOBJECT) index.html
|
|
rm -R html
|
|
|
|
doxy:
|
|
$(DOXY)
|
|
# ln -s html/index.html index.html
|
|
|
|
test: $(TEST)
|
|
./$(TEST)
|
|
|
|
#sets project as sample solution
|
|
setsample:
|
|
cp customer_list.c.sample customer_list.c
|
|
cp customer_list.h.sample customer_list.h
|
|
|
|
#sets project as assignment
|
|
setassignment:
|
|
cp customer_list.c.assignment customer_list.c
|
|
cp customer_list.h.assignment customer_list.h
|
|
|
|
# defines current state of project as sample solution
|
|
definesample:
|
|
cp customer_list.c customer_list.c.sample
|
|
cp customer_list.h customer_list.h.sample
|
|
|
|
# defines current sate of project as assignment
|
|
defineassignment:
|
|
cp customer_list.c customer_list.c.assignment
|
|
cp customer_list.h customer_list.h.assignment
|
|
|
|
# creates a folder which can serve as a publishable assignment
|
|
assignmentfolder:
|
|
make setsample
|
|
make doxy
|
|
make setassignment
|
|
mkdir ../assignment
|
|
cp -R * ../assignment
|
|
rm ../assignment/*.sample
|
|
rm ../assignment/*.assignment
|
|
make cleanall
|
|
|
|
%.o: %.cpp $(HDRS)
|
|
$(CC) $(CCOPTIONS) -c $<
|