On 2007-06-05 09:26Z, Manuel Preliteiro wrote: > Hello, i'm trying to create a makefile with dinamic paths. > > I belive what I want is simple, but I'm having troubles finding what i > need in the documentation, i thought what i would need was in section > 6.2 (2 flavours of variables) but it didnt work as intended.
8.11 The shell Function > I have the following definition: > > OCAMLC = ocamlc > OCAMLIBS = $(OCAMLC) -where > /* This line returns the path i want --> > /home/manuel/godi/lib/ocaml/std-lib */ At this point, the second variable would expand to the string "ocamlc -where". This is only text substitution. You want command substitution, so that it holds the result of executing that string in a shell. Try: OCAMLC := ocamlc OCAMLIBS := $(shell $(OCAMLC) -where) Normally you'd use simply-expanded variables here, so that the command is run only once. > and then inside a rule i have: > $(CC) -I $(OCAML_LIBS) -c testing.c > > The desired output would be: > cc -I /home/manuel/godi/lib/ocaml/std-lib -c testing.c > > But i'm geting > cc -I ocamlc -where -c testing _______________________________________________ Help-make mailing list [email protected] http://lists.gnu.org/mailman/listinfo/help-make
