make -k(keep going)命令会在发现错误时继续执行(用于一次发现所有错误)

版权声明:本文为博主原创文章,遵循 CC 4.0 by-sa 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/stpeace/article/details/53048517

        我们在执行makefile进行编译的时, 会经常遇到错误, 然后解决, 然后又make,  然后又发现错误, 然后又解决, 烦人, 能不能一次发现所有错误呢? 

        能的!


        main.cpp很简单, 我们只看makefile(故意写成错误的g+++):

main: main.o 
	g+++ -o main main.o
main.o: main.cpp
	g+++ -o main.o -c main.cpp

clean:
	rm -f main *.o

        我们先来复习一下上次的make -n, 如下:

taoge@localhost Desktop> make -n
g+++ -o main.o -c main.cpp
g+++ -o main main.o
        再来看一下make -k

taoge@localhost Desktop> make 
g+++ -o main.o -c main.cpp
make: g+++: Command not found
make: *** [main.o] Error 127
taoge@localhost Desktop> 
taoge@localhost Desktop> 
taoge@localhost Desktop> 
taoge@localhost Desktop> make -k
g+++ -o main.o -c main.cpp
make: g+++: Command not found
make: *** [main.o] Error 127
make: Target `main' not remade because of errors.
taoge@localhost Desktop> 

       一目了然。

展开阅读全文

make时出现错误:*** No rule to make target `'????

05-10

在Linux(RedHat 9)下安装一个软件OpenPBS,configure后,在make时出现下面的错误:rnmake[4]: *** No rule to make target `', needed by `attr_atomic.o'. Stop.rn不知何解?全部屏幕信息如下,请高手帮忙分析一下,高分相赠。rnrn--------------------------------------------------------------rnmake[1]: Entering directory `/work/OpenPBS_2_3_16/doc'rnmake[1]: `soelim' is up to date.rnmake[1]: Leaving directory `/work/OpenPBS_2_3_16/doc'rnMaking all in srcrnmake[1]: Entering directory `/work/OpenPBS_2_3_16/src'rnMaking all in includernmake[2]: Entering directory `/work/OpenPBS_2_3_16/src/include'rnmake[2]: Leaving directory `/work/OpenPBS_2_3_16/src/include'rnMaking all in librnmake[2]: Entering directory `/work/OpenPBS_2_3_16/src/lib'rnMaking all in Libattrrnmake[3]: Entering directory `/work/OpenPBS_2_3_16/src/lib/Libattr'rngenerating dependenciesrnmakedepend-sh: processing ./attr_atomic.crnmakedepend-sh: processing ./attr_fn_acl.crnmakedepend-sh: processing ./attr_fn_arst.crnmakedepend-sh: processing ./attr_fn_b.crnmakedepend-sh: processing ./attr_fn_c.crnmakedepend-sh: processing ./attr_fn_hold.crnmakedepend-sh: processing ./attr_fn_intr.crnmakedepend-sh: processing ./attr_fn_l.crnmakedepend-sh: processing ./attr_fn_ll.crnmakedepend-sh: processing ./attr_fn_resc.crnmakedepend-sh: processing ./attr_fn_size.crnmakedepend-sh: processing ./attr_fn_str.crnmakedepend-sh: processing ./attr_fn_time.crnmakedepend-sh: processing ./attr_fn_unkn.crnmakedepend-sh: processing ./attr_func.crnmakedepend-sh: processing ./attr_node_func.crnmakedepend-sh: processing ./Long_.crnmakedepend-sh: processing ./LTostr.crnmakedepend-sh: processing ./uLTostr.crnmakedepend-sh: processing ./strToL.crnmakedepend-sh: processing ./strTouL.crnmake[4]: Entering directory `/work/OpenPBS_2_3_16/src/lib/Libattr'rnmake[4]: *** No rule to make target `', needed by `attr_atomic.o'. Stop.rnmake[4]: Leaving directory `/work/OpenPBS_2_3_16/src/lib/Libattr'rnmake[3]: *** [all] Error 2rnmake[3]: Leaving directory `/work/OpenPBS_2_3_16/src/lib/Libattr'rnmake[2]: *** [all] Error 2rnmake[2]: Leaving directory `/work/OpenPBS_2_3_16/src/lib'rnmake[1]: *** [all] Error 2rnmake[1]: Leaving directory `/work/OpenPBS_2_3_16/src'rnmake: *** [all] Error 2rn 论坛

交叉编译mysql5.1.63,make时的错误

05-24

pc平台: red hat linux 9rn交叉编译器:arm-linux-gcc4.3.2rnmysql版本:mysql-5.1.63.tar.gzrn目的:把MySQL移植到了FL2440的开发板上rn====================================================rnrnmysql貌似没有很好支持交叉编译,修改了一下configure文件以后,./configure成功rn#./configure --host=arm-linux -with-named-curses-libs=/usr/lib/libncurses.so.5 --prefix=/usr/local/mysqlrn-----------------------------------------------------rnrn在mysql5.1.63文件夹中,make时的错误:rnrnstacktrace.c: In function `safe_print_str':rnstacktrace.c:85: [color=#FF0000]`SYS_gettid' undeclared[/color] (first use in this function)rnstacktrace.c:85: (Each undeclared identifier is reported only oncernstacktrace.c:85: for each function it appears in.)rnmake[1]: *** [stacktrace.o] Error 1rnmake[1]: Leaving directory `/usr/local/src/mysql-5.1.63/mysys'rnmake: *** [all-recursive] Error 1rn-----------------------------------------------------rnrnmakefile中部分内容:rnrnAWK = gawkrnCC = arm-linux-gccrnCCAS = arm-linux-gccrnCCASDEPMODE = depmode=gccrnCCASFLAGS = -g -O2 rnCCDEPMODE = depmode=gccrnCC_VERSION = 2.95.3rnCFLAGS = -g -O2 -DUNIV_LINUX -DUNIV_LINUXrnCHECK_PID = /bin/kill -0 $$PID > /dev/null 2> /dev/nullrnCHMOD = /bin/chmodrnCLIENT_EXTRA_LDFLAGS = rnCLIENT_LIBS = -lcrypt -lnsl -lm $(top_builddir)/zlib/libzlt.la rnCLIENT_THREAD_LIBS = -lpthreadrnCMP = /usr/bin/cmprnCOMPILATION_COMMENT = Source distributionrnCONF_COMMAND = ./configure '--host=arm-linux' '-with-named-curses-libs=/usr/lib/libncurses.so.5' '--prefix=/usr/local/mysql' 'host_alias=arm-linux'rnCP = /bin/cprnCPP = arm-linux-gcc -ErnCPPFLAGS = rnCXX = arm-linux-g++rnCXXCPP = arm-linux-g++ -ErnCXXDEPMODE = depmode=gccrnCXXFLAGS = -O3 -fno-implicit-templates -fno-exceptions -fno-rtti -DUSE_PRAGMA_IMPLEMENTATIONrnCXXLDFLAGS = rnCXX_VERSION = 2.95.3rnCYGPATH_W = echornDEFS = -DHAVE_CONFIG_HrnDEPDIR = .depsrnDIFF = /usr/bin/diffrnDOT_FRM_VERSION = 6rnDOXYGEN = /usr/bin/doxygenrnDSYMUTIL = rnDUMPBIN = rnDVIS = manual.dvirnECHO_C = rnECHO_N = -nrnECHO_T = rnEGREP = /bin/grep -ErnEXEEXT = rnFGREP = /bin/grep -FrnFIND_PROC = /bin/ps wwwp $$PID | grep -v " grep" | grep -v mysqld_safe | grep -- "$$MYSQLD" > /dev/nullrnGETCONF = getconfrnGREP = /bin/greprnGXX = yesrnHOSTNAME = /bin/hostnamernINNODB_DYNAMIC_CFLAGS = -DMYSQL_DYNAMIC_PLUGINrnINSTALL = /usr/bin/install -crnINSTALL_DATA = $INSTALL -m 644rnINSTALL_PROGRAM = $INSTALLrnINSTALL_SCRIPT = $INSTALLrnINSTALL_STRIP_PROGRAM = $(install_sh) -c -srnKILL = /bin/killrnLD = /usr/local/arm/2.95.3/arm-linux/bin/ldrnLDFLAGS = -rdynamic rnLD_VERSION_SCRIPT = -Wl,--version-script=$(top_builddir)/libmysql/libmysql.verrnLIBDL = -ldl rnLIBEDIT_LOBJECTS = unvis.o vis.o strlcpy.o strlcat.o fgetln.ornLIBOBJS = rnLIBS = -lpthread -lcrypt -lnsl -lm -lpthread rnLIBTOOL = $(SHELL) $(top_builddir)/libtool --preserve-dup-depsrnLIB_EXTRA_CCFLAGS = rnLIPO = rnLM_CFLAGS = rnLN = /bin/lnrnLN_CP_F = /bin/ln -srnLN_S = ln -srnLTLIBOBJS = rnMACHINE_TYPE = armrnMAKEINDEX = /usr/bin/makeindexrnMAKEINFO = $SHELL /usr/local/src/mysql-5.1.63/missing --run makeinfornMAKE_BINARY_DISTRIBUTION_OPTIONS = rnMAKE_SHELL = /bin/shrnMKDIR_P = /bin/mkdir -prnMV = /bin/mvrnMYSQLD_DEFAULT_SWITCHES = --skip-external-lockingrnMYSQLD_EXTRA_LDFLAGS = rnMYSQLD_EXTRA_LIBS = rnMYSQLD_USER = mysqlrnMYSQL_BASE_VERSION = 5.1rnMYSQL_COPYRIGHT_YEAR = 2012rnMYSQL_NO_DASH_VERSION = 5.1.63rnMYSQL_PREVIOUS_BASE_VERSION = 5.0rnMYSQL_SERVER_SUFFIX = rnMYSQL_TCP_PORT = 3306rnMYSQL_TCP_PORT_DEFAULT = 0rnMYSQL_UNIX_ADDR = /tmp/mysql.sockrnMYSQL_U_SCORE_VERSION = 5.1.63rnMYSQL_VERSION_ID = 50163rnNDB_DEFS = rnNDB_LD_VERSION_SCRIPT = rnNDB_SCI_INCLUDES = rnNDB_SCI_LIBS = rnNDB_SHARED_LIB_MAJOR_VERSION = 3rnNDB_SHARED_LIB_VERSION = 3:0:0rnNDB_SIZEOF_CHAR = rnNDB_SIZEOF_CHARP = rnNDB_SIZEOF_INT = rnNDB_SIZEOF_LONG = rnNDB_SIZEOF_LONG_LONG = rnNDB_SIZEOF_SHORT = rnNDB_VERSION_BUILD = 63rnNDB_VERSION_MAJOR = 5rnNDB_VERSION_MINOR = 1rnNDB_VERSION_STATUS = rnNM = /usr/local/arm/2.95.3/bin/arm-linux-nm -BrnNMEDIT = rnNOINST_LDFLAGS = -staticrnNON_THREADED_LIBS = -lcrypt -lnsl -lm rnOBJDUMP = arm-linux-objdumprnOBJEXT = ornOTOOL = rnOTOOL64 = rnPACKAGE = mysqlrnPACKAGE_BUGREPORT = rnPACKAGE_NAME = MySQL ServerrnPACKAGE_STRING = MySQL Server 5.1.63rnPACKAGE_TARNAME = mysqlrnPACKAGE_VERSION = 5.1.63rnPATH_SEPARATOR = :rnPDFLATEX = /usr/bin/pdflatexrnPDFMANUAL = manual.pdfrnPERL = /usr/bin/perlrnPERL5 = /usr/bin/perlrnPROTOCOL_VERSION = 10rnPS = /bin/psrnRANLIB = arm-linux-ranlibrnRM = /bin/rmrnSAVE_ASFLAGS = rnSAVE_CC = arm-linux-gccrnSAVE_CFLAGS = -g -O2rnSAVE_CXX = rnSAVE_CXXFLAGS = rnSAVE_CXXLDFLAGS = rnSAVE_LDFLAGS = rnSED = /bin/sedrnSET_MAKE = rnSHARED_LIB_MAJOR_VERSION = 16rnSHARED_LIB_VERSION = 16:0:0rnSHELL = /bin/shrnSTATIC_NSS_FLAGS = rnSTRIP = arm-linux-striprnSYSTEM_TYPE = unknown-linux-gnurnTAR = gtarrnTARGET_LINUX = truernTERMCAP_LIB = /usr/lib/libncurses.so.5rnTEST_NDBCLUSTER = rnTHREAD_LOBJECTS = thr_alarm.o thr_lock.o thr_mutex.o thr_rwlock.o my_pthread.o my_thr_init.o mf_keycache.ornVERSION = 5.1.63rnWRAPLIBS = rnYACC = bison -y -p MYSQLrnZLIB_DEPS = -lzrnZLIB_INCLUDES = -I$(top_srcdir)/zlibrnZLIB_LIBS = $(top_builddir)/zlib/libzlt.larnabs_builddir = /usr/local/src/mysql-5.1.63rnabs_srcdir = /usr/local/src/mysql-5.1.63rnabs_top_builddir = /usr/local/src/mysql-5.1.63rnabs_top_srcdir = /usr/local/src/mysql-5.1.63rnac_ct_CC = rnac_ct_CXX = rnac_ct_DUMPBIN = rnam__include = includernam__leading_dot = .rnam__quote = rnam__tar = pax -L -x ustar -w "$$tardir"rnam__untar = pax -rrnbindir = $exec_prefix/binrnbuild = i686-pc-linux-gnurnbuild_alias = rnbuild_cpu = i686rnbuild_os = linux-gnurnbuild_vendor = pcrnbuilddir = .rncondition_dependent_plugin_includes = -I$(top_srcdir)/storage/heap/ -I$(top_srcdir)/storage/myisam/ -I$(top_srcdir)/storage/myisammrg/rncondition_dependent_plugin_links = storage/heap/ha_heap.cc storage/myisam/ha_myisam.cc storage/myisammrg/ha_myisammrg.ccrncondition_dependent_plugin_modules = ha_heap.cc ha_myisam.cc ha_myisammrg.ccrncondition_dependent_plugin_objects = ha_heap.o ha_myisam.o ha_myisammrg.orndatadir = $datarootdirrndatarootdir = $prefix/sharerndocdir = $datarootdir/doc/$PACKAGE_TARNAMErndocs_dirs = Docsrndvidir = $docdirrnexec_prefix = $prefixrnextra_docs = rnhost = arm-unknown-linux-gnurnhost_alias = arm-linuxrnhost_cpu = armrnhost_os = linux-gnurnhost_vendor = unknownrnhtmldir = $docdirrnincludedir = $prefix/includerninfodir = $datarootdir/inforninnodb_system_libs = -lrtrninstall_sh = $(SHELL) /usr/local/src/mysql-5.1.63/install-shrnlibdir = $exec_prefix/librnlibexecdir = $exec_prefix/libexecrnlibmysqld_dirs = rnlocaledir = $datarootdir/localernlocalstatedir = $prefix/varrnlt_ECHO = echornrn求成功移植mysql的大侠指教!rn 论坛

Keeps Going and Going and ...

02-19

Lazy functional languages like Haskell and Miranda support features that are not found in other programming languages, including infinite lists. Consider the following simple (and useful) recursive declaration:nletrecn count n = cons n (count (n+1))ninn count 0nnThe function cons constructs lists, so the above declaration creates the following structure:nncons 0 (count 1)n= cons 0 (cons 1 (count 2))n= cons 0 (cons 1 (cons 2 ...))n= [0,1,2,...]nnLazy languages can do this because they only evaluate expressions that are actually used. If a program creates an infinite list and only looks at items 2 and 3 in it, the values in positions 0 and 1 are never evaluated and the list structure is only evaluated so far as the fourth node.nnIt is also possible to use more than one function to build an infinite list. Here is a declaration that creates the list ["even","odd","even",...]:nnletrecn even = cons "even" oddn odd = cons "odd" evenninn evennnThere are also functions that manipulate infinite lists. The functions take and drop can be used to remove elements from the start of the list, returning the (removed) front elements or the remainder of the list, respectively. Another useful function is zip, which combines two lists like the slider on a zipper combines the teeth. For example,nnzip (count 0) (count 10) = [0,10,1,11,2,12,...]nnYour task is to implement a subset of this functionality.nnnThis problem contains multiple test cases!nnThe first line of a multiple input is an integer N, then a blank line followed by N input blocks. Each input block is in the format indicated in the problem description. There is a blank line between input blocks.nnThe output format consists of N output blocks. There is a blank line between output blocks.nnnInputnnThe first line of input consists of two positive integers, n and m. n is the number of declarations to follow and m is the number of test cases.nnEach declaration takes the form name = expr. There are two forms for expr : zip name1 name2 and x0 x1 ... xi name3. In the first case, name is the result of zipping name1 and name2 together. The other case defines the first i + 1 non-negative integers in the list name (where i is at least 0) and name3 is the name of the list that continues it (mandatory--all lists will be infinite).nnThe test cases take the form name s e, where s and e are non-negative integers, s <= e and e - s < 250.nnNo line of input will be longer than 80 characters. Names consist of a single capital letter.nnnOutputnnFor each test case, print the integers in positions s to e of the list name. List elements are numbered starting with 0.nnnSample Inputnn1nn5 3nS = 4 3 2 1 AnO = 1 OnE = 0 EnA = zip E OnZ = zip Z SnA 43455436 43455438nS 2 5nZ 1 10nnnSample Outputnn0 1 0n2 1 0 1n4 4 3 4 2 3 1 4 0 2 问答

没有更多推荐了,返回首页