📄 makefile
字号:
#------------------------------------------------------------------------------# Makefile for EARS# Beware! You need a filesystem that allows names longer than 14 chars.#------------------------------------------------------------------------------# User defined section#------------------------------------------------------------------------------OPT_DEBUG = -O#OPT_DEBUG = -g # uncomment this line if you want to debugGUI = -DUI_NCURSES#GUI = -DUI_RAW # uncomment this if ncurses version does not work#SOUNDDEFS = -DVOXWARE # uncomment if you have Linux kernel sound driverSOUNDDEFS = -DOSS # uncomment if you have Open Sound SystemSOUND_INCLUDE = -I/var/lib/oss # the path where your OSS soundcard.h lives#SOUNDDEFS = -DSUN # uncomment if you have Sun sound #SOUND_INCLUDE = -I/usr/demo/SOUND/include#OTHERLIBS = -L/usr/demo/SOUND/lib -laudio -lm#SOUNDDEFS = -DAF # uncomment if you have AF sound (incomplete)RECOGS = -DR_DTWCOMP = gccCC = gcc#------------------------------------------------------------------------------# You should not need to change anything below this line.#------------------------------------------------------------------------------exportVERSION = 0.32dirname = ears-$(VERSION)includedirs =-I. $(SOUND_INCLUDE)subdirs = ears modules mrasta ui othersalldirs = $(subdirs) doc util contribmylibs = $(foreach dir,$(subdirs),$(dir)/lib$(dir).a)sources = $(foreach dir,$(subdirs),$(wildcard $(dir)/*.cc $(dir)/*.c))sources += train_ears.cc listen.ccother_files = Makefile CHANGES COPYING HELP.* README* TODO *.wordsifeq ($(GUI),-DUI_NCURSES) guilibs = -lpanel -lncursesendif libs = $(mylibs) -lstdc++ $(guilibs) $(OTHERLIBS)ifeq (configured,$(wildcard configured))elseconfigured: # # Note: You need the following things to compile successfully: # - gcc-2.7.2 and up # - libstdc++.a from libg++-2.7.1.4 and up # - libncurses.a / libpanel.a from ncurses-1.9.9e and up # @sh util/configure @touch configuredendif#-------------------------------------------------------------------------------all: configured depend allprogsallprogs: train_ears listentrain_ears: $(mylibs) train_ears.o $(COMP) $(LIBPATH) -o train_ears train_ears.o $(libs)listen: $(mylibs) listen.o $(COMP) $(LIBPATH) -o listen listen.o $(libs) # Libraries are named so that libx.a is found in subdirectory x%.a: make -C $(@D) $(@F)%.o: %.cc @make --no-print-directory -C $(@D) $(@F)%.o: %.c @make --no-print-directory -C $(@D) $(@F)train_ears.o listen.o: $(COMP) -c $(includedirs) $*.cc#------------------------------------------------------------------------------# cleaning up#------------------------------------------------------------------------------newrec: # delete recorded files and recognizers rm -f $(HOME)/.ears/*.NDTW rm -f $(HOME)/.ears/*.DTW rm -rf $(HOME)/.ears/MRASTA-V rm -rf $(HOME)/.ears/rawuninstall: # remove all data files rm -r $(HOME)/.ears rm $(HOME)/.earsrcdeltrash: # delete all these annoying files rm -f \#* *\# *~ *.orig *.rej core t a.out DEADJOE tmp .remind rm -f doc/*~ util/*~ contrib/*~ gmon.out bb.out log tt for d in $(subdirs); do make -C $$d deltrash; doneclean: # everything except configuration rm -f \#* *\# *~ *.orig *.rej core t a.out DEADJOE tmp .remind rm -f doc/*~ util/*~ contrib/*~ gmon.out bb.out log tt rm -f *.o .depend listen train_ears rm -rf $(dirname) for d in $(subdirs); do make -C $$d clean; donemostlyclean: clean distclean: # make it as if you had just unpacked the distribution rm -f \#* *\# *~ *.orig *.rej core t a.out DEADJOE tmp .remind rm -f doc/*~ util/*~ contrib/*~ gmon.out bb.out log tt rm -f *.o .depend listen train_ears configured rm -rf $(dirname) rm -f TAGS tags for d in $(subdirs); do make -C $$d distclean; donerealclean: distclean # delete everything that can't be build by any meansveryclean: realclean # this is not GNU, but I'm used to it#------------------------------------------------------------------------------# documentation, version control#------------------------------------------------------------------------------info: @echo "Not yet implemented."dvi: infoci: @ci -u -q0.20.1 $(ALLSRCS) README* HELP.* for d in $(subdirs); do make -C $$d ci; done#------------------------------------------------------------------------------# packing a distribution and backup#------------------------------------------------------------------------------dist: # not exactly elegant, but it works for now :-) -chmod -R 777 $(dirname) rm -f doc/*~ *~ rm -rf $(dirname) mkdir $(dirname) for d in $(alldirs); do mkdir $(dirname)/$$d; done ln train_ears.cc listen.cc $(other_files) $(dirname) for d in $(alldirs); do ln $$d/* $(dirname)/$$d; done chmod 777 $(dirname) # some old versions of tar need world writable for d in $(alldirs); do chmod 666 $(dirname)/$$d/*; done chmod 666 $(dirname)/* for d in $(alldirs); do chmod 777 $(dirname)/$$d; done tar czf ../ears-$(VERSION).tar.gz $(dirname) rm -rf $(dirname) bindist: train_ears listen # assumes that binaries are built already strip listen train_ears rm -f doc/*~ *~ -chmod -R 777 $(dirname) rm -rf $(dirname) mkdir $(dirname) mkdir $(dirname)/doc mkdir $(dirname)/contrib# we can't rely on symbolic links ln train_ears listen README COPYING *.words HELP.* $(dirname) ln doc/* $(dirname)/doc ln contrib/* $(dirname)/contrib chmod 777 $(dirname) # some old versions of tar need world writable chmod 666 $(dirname)/doc/* $(dirname)/contrib/* $(dirname)/* chmod 777 $(dirname)/listen $(dirname)/train_ears chmod 777 $(dirname)/doc $(dirname)/contrib tar czf ../ears-$(VERSION)-bin.tar.gz $(dirname) rm -rf $(dirname) archive := ../EA$(shell date +%y%m%d).TGZbkp: deltrash find . -maxdepth 2 -type f ! -perm +100 ! -name ".depend"\ ! -name "*.o" ! -name "COPYING" ! -name "*.a" ! -name "*,v" >tmp tar cfTz $(archive) tmp mcopy -n $(archive) a: mcopy -n $(archive) a:bkp rm $(archive) tmp mdir a:rcsbkp: tar cfz ears-rcs.tgz RCS/* */RCS */RCS/* mcopy -n ears-rcs.tgz a: rm ears-rcs.tgz mdir a:#------------------------------------------------------------------------------# more dependencies#------------------------------------------------------------------------------ifeq (.depend,$(wildcard .depend))include .dependdepend:elsedepend: $(sources) touch .depend for d in $(subdirs) .; do\ $(CPP) $(includedirs) $(SOUNDDEFS) $(RECOGS) $(GUI) -MM $$d/*.c $$d/*.cc\ 2>/dev/null | sed "s/^[a-z]/$$d\/&/g" >>.depend;\ done for d in $(subdirs); do\ echo $$d/lib$$d.a: $$d/*.c $$d/*.cc 2>/dev/null\ | sed 's/\b\w*\b\/\*\.cc\?//g' | sed 's/\.cc\?/\.o/g' >>.depend;\ done @for d in $(subdirs); do make -C $$d depend; doneendif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -