diff options
| author | Cliff Click <cliffc@acm.org> | 2026-09-22 11:25:05 -0700 |
|---|---|---|
| committer | Cliff Click <cliffc@acm.org> | 2026-09-22 11:25:05 -0700 |
| commit | 29fb671e69f90ad3b04c6fa8d746caf857f89e77 (patch) | |
| tree | 2f39d082f8a6de6a2b60b66406f8c9f0190d25c2 /chapter24/Makefile | |
| parent | 1d961838cff168a101069d08a8ab6594f49f0911 (diff) | |
| download | Simple-29fb671e69f90ad3b04c6fa8d746caf857f89e77.tar.gz Simple-29fb671e69f90ad3b04c6fa8d746caf857f89e77.zip | |
Add shared graph viewer to all chapters
Diffstat (limited to 'chapter24/Makefile')
| -rw-r--r-- | chapter24/Makefile | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/chapter24/Makefile b/chapter24/Makefile index 42ba8a03..94605e84 100644 --- a/chapter24/Makefile +++ b/chapter24/Makefile @@ -64,6 +64,7 @@ CLZDIR:= build/classes main_javas := $(wildcard $(SRC)/$(SIMPLE)/*java $(SRC)/$(SIMPLE)/*/*java $(SRC)/$(SIMPLE)/node/cpus/*/*java) test_javas := $(wildcard $(TST)/$(SIMPLE)/*java $(TST)/$(SIMPLE)/*/*java) main_classes := $(patsubst $(SRC)/%java,$(CLZDIR)/main/%class,$(main_javas)) +include $(firstword $(wildcard ../graph/graph.mk graph/graph.mk)) test_classes := $(patsubst $(TST)/%java,$(CLZDIR)/test/%class,$(test_javas)) test_cp := $(patsubst $(TST)/$(SIMPLE)/%.java,com.seaofnodes.simple.%,$(wildcard $(TST)/$(SIMPLE)/*Test.java)) com.seaofnodes.simple.codegen.X86EncodingTest classes = $(main_classes) $(test_classes) @@ -72,7 +73,7 @@ libs = $(wildcard lib/*jar) jars = $(subst $(space),$(SEP),$(libs)) -default_targets := $(CLZDIR)/.tag $(test_classes) +default_targets := $(CLZDIR)/main/.mtag $(CLZDIR)/test/.ttag # Optionally add ctags to the default target if a reasonable one was found. ifneq ($(CTAGS),) default_targets += tags @@ -81,18 +82,17 @@ endif default: $(default_targets) ####################################################### -# Compile just the out-of-date files +# Compile the chapter and shared viewer sources together -OODM := -$(CLZDIR)/main/.mtag: $(main_classes) $(main_javas) +$(CLZDIR)/main/.mtag: $(main_javas) Makefile @[ -d $(CLZDIR)/main ] || mkdir -p $(CLZDIR)/main @# This crap is really just "javac", but with a beautiful error message. @# The very very long list of java files is suppressed and counted. @# The required output "Note: blah blah deprecated blah" is suppressed. - $(file >.argsM.txt,$(OODM)) - @if [ ! -z "$(OODM)" ] ; then \ + $(file >.argsM.txt,$(main_javas)) + @if [ ! -z "$(main_javas)" ] ; then \ echo "compiling main because " $< " and " `wc -w < .argsM.txt` " more files" ; \ - if ! javac $(JAVAC_ARGS) -cp "$(CLZDIR)/main$(SEP)$(jars)" -sourcepath $(SRC) -d $(CLZDIR)/main $(OODM) >& .out.txt ; then \ + if ! javac $(JAVAC_ARGS) -cp "$(CLZDIR)/main$(SEP)$(jars)" -sourcepath $(SRC) -d $(CLZDIR)/main $(main_javas) >& .out.txt ; then \ cat .out.txt ; \ exit 1; \ fi ; \ @@ -101,9 +101,8 @@ $(CLZDIR)/main/.mtag: $(main_classes) $(main_javas) @touch $(CLZDIR)/main/.mtag @rm -f .argsM.txt -# Collect just the out-of-date files -$(main_classes): $(CLZDIR)/main/%class: $(SRC)/%java - $(eval OODM += $$<) +$(main_classes): $(CLZDIR)/main/.mtag + ####################################################### @@ -151,11 +150,6 @@ build/release/simple.jar: $(CLZDIR)/main/.mtag $(CLZDIR)/test/.ttag @[ -d $(dir $@) ] || mkdir -p $(dir $@) @jar cf build/release/simple.jar -C $(CLZDIR)/main . -C $(CLZDIR)/test . -C $(SRC)/$(SIMPLE) . -C $(TST)/$(SIMPLE) . -# Launch viewer -.PHONY: view -view: $(CLZDIR)/main/.mtag - @echo "viewing " - @$(JVM) com.seaofnodes.simple.print.JSViewer .PHONY: clean clean: @@ -185,3 +179,6 @@ spill-stats: $(CLZDIR)/main/.mtag $(CLZDIR)/test/.ttag @$(JVM) com.seaofnodes.simple.SpillStats .PHONY: spill-stats + +.PHONY: build +build: $(CLZDIR)/main/.mtag |
