I have been given the following Makefile I should compile some complex project, but the makefile itself does not do it, even if I I am trying to modify it to work. I am studying the GNU manual but I have written the makefile in a very old style and I am not able to fix it.
Line:
$ (exe): $ (oBJS) bla =; For file in $ (OBJS); Do bla = "$$ bla` $$ file`"; done; \ $ (Cfa) $ $ (CFFALAGS) $ (CFAFALAGS) -A $ @ $$ BLA $ (ADDLBS) $ (LIBS)
This is a complete Makefile:
# //////////////// NOMBRE DEL PROYECTO //////// ////////// # P = Project # EXE = $ (P) OBJS = Main.o Model.o Ultimate A. head.h ADDLIBS = -D ADDINCFLAGS = I SRCDIR = Root / Projects / Project ########## CXX = G ++ CXXFLAGS = -O3 -Fomit Frame-Indicator -Pipe -DNDEBUG -pedantic-Errors -Wparentheses -Wreturn Type -Wcast-qual - Wall -Wpointer-arith -Wwrite-wire -Wconversion I $ (COININCDIR) CXXLINKFLAGS = -Wl, - rpath -Wl, / install / CoinAll / lib cc = GCC CFLAGS = -03 -fomit frame-pointer -Pipe - DNDEBUG -pedantic -Roots -Wimplicit -Wparentheses -Wsequence point -Wreturn type -Wcast-qual -Wall COININCDIR = / installed / CoinAll / included / coin COINLIBDIR = / install / CoinAll / lib LIBS = L $ (COINLIBDIR) - lCbc -lCgl -lOsiClp - LOsi -lClp -lCoinUtils -lm `cat $ (COINLIBDIR) / cgl_addlibs.txt` \ cat $ (COINLIBDIR) / clp_addlibs.txt` \ Cat $ (COINLIBDIR) / coinutils_addlibs.txt` # LIBS = L $ (COINLIBDIR) -lClp -lCoinUtils \ # -lm Cat $ ($ COINLIBDIR) / coinutils_addlibs.txt` INCL = -I` $ (COININCDIR) `$ (ADDINCFLAGS ) All: $ (EXE) .SUFFIXES: CPP. C. O OAB $ (XE): $ (OBJS) BLA =; For file in $ (OBJS); Do bla = "$$ bla` $$ file`"; done; $ $ (CXX) $ (CXXLINKFLAGS) $ (CXXFLAGS) -o $ @ $$ bla $ (ADDLIBS) $ (LIBS) .cpp.o: $ (CXX) $ (CXXFLAGS) $ (inclusive) -c -o $ @ 'Test-F' $ & lt; ' || Echoes '$ (SRCDIR) /' $ $ & lt; .cpp.obj: $ (CXX) $ (CFLAGS) $ (INLL) -C-O $ @ `If Test-F '$ & lt;'; Then '$ & lt;'; Other '$ (SRCDIR) / $ & lt;'; Fi .CO: $ (CC) $ (CFLAGS) $ (INCL) -Co o $ @ `Test-F '$ & lt;' || Echoes '$ (SRCDIR) /' $ $ & lt; .c.obj: $ (CC) $ (CFLAG) $ (INLL) -C-O $ @ if 'test -f' $ & lt; '; Then '$ & lt;'; Other '$ (SRCDIR) / $ & lt;'; The first question is that entries in `$ (OBJS) are actually for the command I \\\ 'which is intended to run for their output and then used in their link line?
Because if not, the backticks are wrong and the whole loop can be removed and that body has been replaced with it:
$ (CXX) $ (cxxflgas ) $ (CFFLAGS) -O $ @ $ (OBJS) $ (ADDLBS) $ (LBS)
Given that the value of
$ (OBJS) is
main.o model.o param.o head.h
(And the fact is that the file in a list of a.h
objects is strange) I think that The above possibility The Minister.But, for just perfection, we assume that it is not and these objects really want to be executed for the output in that case the body can be replaced:
$ (CFA) $ (CFFLAGS) -o $ @ $ (pattsbst%, `%`, $ (objs)) $ (ADDLIBS) $ (LIBS)
Two last commentbacks (they believe they are right in the first place) inside there is no reason for space and Nbv that
is no reason to pre-announced the $ bla =
.
Comments
Post a Comment