From 293eabc1b691e6e46f407fd6f6222d1900828d75 Mon Sep 17 00:00:00 2001 From: Loc Hoang Date: Mon, 21 Nov 2016 23:22:16 -0600 Subject: [PATCH] comments for top level Rules and java rules/dummy --- Rules.mk | 3 +++ java/Rules.mk | 3 +++ java/dummy/Makefile | 1 + 3 files changed, 7 insertions(+) diff --git a/Rules.mk b/Rules.mk index 89f0baa..13c73ff 100644 --- a/Rules.mk +++ b/Rules.mk @@ -1,6 +1,9 @@ +# Compiles the source file using the specified compiler + flags +# Note $< is the first specified dependency, in this case the source compile: $(SRC) $(CC) $(CFLAGS) $< +# Runs the code. run: compile $(RUNCMD) $(RUNFLAGS) $(TEST_FILE) diff --git a/java/Rules.mk b/java/Rules.mk index ae039e8..a0edab3 100644 --- a/java/Rules.mk +++ b/java/Rules.mk @@ -1,7 +1,10 @@ +# Specify how to compile + how to run CC:=javac CFLAGS:= OBJ:=$(SRC:.java=.class) RUNCMD:=java RUNFLAGS:=-cp . $(OBJ:.class=) +# include the top level Rules.mk (note this is called from the context +# of the Makefile in a directory below this one) include ../../Rules.mk diff --git a/java/dummy/Makefile b/java/dummy/Makefile index 9f240b0..65f7720 100644 --- a/java/dummy/Makefile +++ b/java/dummy/Makefile @@ -1,3 +1,4 @@ +# Specify the source file SRC:=Dummy.java include ../Rules.mk