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