Skip to content

Instantly share code, notes, and snippets.

@amir734jj
Created April 5, 2021 07:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amir734jj/645a94412475dfb700f6116dd1c7e1bc to your computer and use it in GitHub Desktop.
Save amir734jj/645a94412475dfb700f6116dd1c7e1bc to your computer and use it in GitHub Desktop.
make: *** No rule to make target 'grammar.aps'. Stop.
SPECS=First Follow
EXAMPLES_PATH=../..
ROOT_PATH=../${EXAMPLES_PATH}
SCALAV=2.12
APSLIB=${ROOT_PATH}/lib/aps-library-${SCALAV}.jar
SCALA_FLAGS=.:${APSLIB}
APS2SCALA=${ROOT_PATH}/bin/aps2scala
.PHONY:
all: $(addsuffix Spec.compile, $(SPECS)) $(addsuffix Spec.run, $(SPECS))
%.class: %.scala
scalac -cp ${SCALA_FLAGS} $<
%.generate:
${APS2SCALA} -DCOT -p ${EXAMPLES_PATH}:${ROOT_PATH}/base $*
%.aps: %.generate %.class
%.run:
@scala -cp ${SCALA_FLAGS} $(basename $*)
GrammarUtil.compile: grammar.aps GrammarUtil.class
FirstSpec.compile: Spec.class GrammarUtil.compile first.aps FirstSpec.class
FollowSpec.compile: Spec.class GrammarUtil.compile follow.aps FollowSpec.class
.PHONY:
clean:
rm -f *.class grammar.scala first.scala follow.scala
@tms13
Copy link

tms13 commented Apr 5, 2021

There are no commands in the rule to create %.aps from %.generate and %.class - that's the likely cause of your problem.

@tms13
Copy link

tms13 commented Apr 5, 2021

The .PHONY: dependencies are wrong - you want .PHONY: all and .PHONY: clean (or you can combine them).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment