+/EE312

software design

git clone https://git.julia.blue/+/EE312

Joseph RyanAdd Project 1 and start Project 2f830e85

master
1.5 KiB75 linesraw
1# New Makefile that automatically depends itself
2#
3# $Id: Makefile,v 1.3 1996/12/17 19:52:37 chase Exp $
4#
5
6IFLAGS = 
7DFLAGS = 
8CXX = g++ #
9CC  = $(GCC)
10GCC = g++ #
11LD  = $(CXX)
12
13LIBS = 
14
15WFLAGS = -Wall 
16SYMFLAGS = -g
17
18PROFILE = #-pg 
19OPTFLAGS =#-O
20CFLAGS = $(OPTFLAGS) $(PROFILE) $(WFLAGS) $(IFLAGS) $(SYMFLAGS)
21CXXFLAGS = $(CFLAGS)
22CPPFLAGS = $(IFLAGS) $(DFLAGS)
23LDFLAGS = $(PROFILE) -g 
24
25PROGRAM = proj2
26#CXXSRCS = Source.cpp
27CXXSRCS = $(shell ls *.cpp)
28
29SRCS = $(CXXSRCS)
30OBJS = $(CXXSRCS:.cpp=.o)
31
32all: $(PROGRAM)
33
34$(PROGRAM): $(OBJS)
35	$(LD) -o $@ $(LDFLAGS) $(OBJS) $(LIBS)
36
37test: $(PROGRAM)
38	-@./$(PROGRAM) testMultiplyMatrixA
39	-@./$(PROGRAM) testMultiplyMatrixB
40	-@./$(PROGRAM) testMultiplyMatrixC
41	-@./$(PROGRAM) testMultiplyMatrixD
42	-@./$(PROGRAM) testTransposeA
43	-@./$(PROGRAM) testTransposeB
44	-@./$(PROGRAM) testTransposeC
45	-@./$(PROGRAM) testMultiplyMatrixPtrA
46	-@./$(PROGRAM) testMultiplyMatrixPtrB
47	-@./$(PROGRAM) testMultiplyMatrixPtrC
48
49clean:
50	-rm -f $(OBJS) $(PROGRAM)
51
52undepend:
53	-rm -f $(OBJS:%.o=.%.d) 
54
55spotless: clean undepend
56
57# auto depend stuff for GNU make only
58depend: undepend
59	@echo ""
60	@echo "Dependences are handled automatically, just \"make\""
61
62ifneq ($(strip $(CSRCS)),)
63.%.d: %.c 
64	$(SHELL) -ec '$(GCC) -MM $(CPPFLAGS) $< > $@'
65
66
67include $(CSRCS:%.c=.%.d)
68endif 
69
70ifneq ($(strip $(CXXSRCS)),)
71.%.d: %.cpp
72	$(SHELL) -ec '$(GCC) -MM $(CPPFLAGS) $< > $@'
73
74include $(CXXSRCS:%.cpp=.%.d) 
75endif