+/EE312
software design
git clone https://git.julia.blue/+/EE312
884d021
master
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 ) 21#CFLAGS = $(OPTFLAGS) $(PROFILE) $(WFLAGS) $(IFLAGS) -o3 22CXXFLAGS = $( CFLAGS ) 23CPPFLAGS = $( IFLAGS ) $( DFLAGS ) 24LDFLAGS = $( PROFILE ) -g 25 26PROGRAM = proj6 27#CXXSRCS = Source.cpp 28 29CXXSRCS = $( shell ls *.cpp) 30 31 32SRCS = $( CXXSRCS ) 33 34OBJS = $( CXXSRCS:.cpp=.o) 35 36all : $( PROGRAM ) 37 38$( PROGRAM ): $( OBJS ) 39$( LD ) -o $ @ $( LDFLAGS ) $( OBJS ) $( LIBS ) 40 41test : $( PROGRAM ) 42./ $( PROGRAM ) 43 44clean : 45 -rm -f $( OBJS ) $( PROGRAM ) 46 47tidy : 48 -rm -f *.BAK *.bak *.CKP 49 50undepend : 51 -rm -f $( OBJS:%.o=.%.d ) 52 53spotless : tidy clean undepend 54 55.y.cpp : 56$( BISON ) $( BISONFLAGS ) -o $ @ $ < 57mv $ @ .h$ * .h 58mv $ @ .output$ * .output 59.l.cpp : 60$( FLEX ) ${ FLEXFLAGS } -t $ < > $ @ 61 62# auto depend stuff for GNU make only 63depend : undepend 64@ echo "" 65@ echo "Dependences are handled automatically, just \"make\"" 66 67ifneq ($( strip $( CSRCS )) ,) 68.%.d : %.c 69$( SHELL ) -ec ' $( GCC ) -MM $( CPPFLAGS ) $ < > $ @' 70 71 72include$( CSRCS:%.c=.%.d) 73endif 74 75ifneq ($( strip $( CXXSRCS )) ,) 76.%.d : %.cpp 77$( SHELL ) -ec ' $( GCC ) -MM $( CPPFLAGS ) $ < > $ @' 78 79include$( CXXSRCS:%.cpp=.%.d) 80endif 81