new question asked in Amazon

Input Make file:

test test e2etest, e2etest binary....>


build: test image e2etest binary

test: <go test ...>

image: test e2etest binary build_image

build_image: <docker build ...>

binary:

e2etest: <./start_test.sh>

Expected output for target: build
<go test ...>
<./start_test.sh>

<docker build ...>


  • Input make file, with build targets, dependent on either other targets or instructions
  • A given build target can have any number of dependent targets or a single instruction
  • You can assume a function "bool isInstrn(string)" which returns a bool if the string passed is an instruction
  • Parse input file, build a data structure, then for a given target print ordered output
  • Write pseduo code in any language for two functions: ParseandBuildDS(string filename), Printoutput(string target)
  • ParseandBuildDS(string filename): accepts name of make file, parses it and creates a data structure out of it
  • Printoutput(string target): accepts a build target and parses the above created data structure and prints expected output
Comments (0)