From 45455353c61ac6bcf1e35f47b837a3e987f47432 Mon Sep 17 00:00:00 2001 From: Xuanyao Fong Date: Thu, 7 Apr 2022 16:08:16 +0800 Subject: [PATCH] added doc --- Makefile | 6 +++--- doc/Makefile | 13 +++++++------ doc/make.go | 15 ++++++++------- 3 files changed, 18 insertions(+), 16 deletions(-) diff --git a/Makefile b/Makefile index 6e296fb..3dcf0a6 100644 --- a/Makefile +++ b/Makefile @@ -6,13 +6,13 @@ GO_BUILDFLAGS=-compiler gc CGO_CFLAGS_ALLOW='(-fno-schedule-insns|-malign-double|-ffast-math)' -BUILD_TARGETS = all cl-binds cl-compiler clkernels clean data data64 draw draw64 dump dump64 engine engine64 freetype gui realclean hooks httpfs mag mag64 oommf oommf64 script script64 timer uMagNUS uMagNUS64 util loader loader64 kernloader kernloader64 libumagnus libumagnus64 +BUILD_TARGETS = all mod cl-binds cl-compiler clkernels clean data data64 draw draw64 dump dump64 engine engine64 freetype gui realclean hooks httpfs mag mag64 oommf oommf64 script script64 timer uMagNUS uMagNUS64 util loader loader64 kernloader kernloader64 libumagnus libumagnus64 .PHONY: $(BUILD_TARGETS) -all: cl-compiler kernloader kernloader64 libumagnus libumagnus64 uMagNUS uMagNUS64 +all: mod cl-compiler kernloader kernloader64 libumagnus libumagnus64 uMagNUS uMagNUS64 go install -v $(GO_BUILDFLAGS) github.com/seeder-research/uMagNUS/cmd/... @@ -27,7 +27,7 @@ hooks: .git/hooks/post-commit .git/hooks/pre-commit ln -sf $(CURDIR)/$< $@ -go.mod: +mod: go mod init diff --git a/doc/Makefile b/doc/Makefile index 1091375..1afe60b 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -2,21 +2,22 @@ BUILDDIR="build" STATIC="static" # build the html pages in ${BUILDDIR} -.PHONY: html -html: doc uMagNUSlibs +.PHONY: doc uMagNUSlibs html clean + +html: uMagNUSlibs doc mkdir -p ${BUILDDIR} ./doc -examples -builddir ${BUILDDIR} cp ${STATIC}/* build -.PHONY: doc + doc: go build -v -.PHONY: mumax3libs + uMagNUSlibs: - $(MAKE) -C $(GOPATH)/src/github.com/seeder-research/uMagNUS uMagNUS + cd $(GOPATH)/src/github.com/seeder-research/uMagNUS && $(MAKE) cl-binds clkernels engine uMagNUS libumagnus clkernels64 engine64 uMagNUS64 libumagnus64 && go install -v github.com/seeder-research/uMagNUS/cmd/... + -.PHONY: clean clean: rm -rf build rm -f doc diff --git a/doc/make.go b/doc/make.go index 2db18c1..94095cb 100644 --- a/doc/make.go +++ b/doc/make.go @@ -12,11 +12,12 @@ import ( "sort" "strings" "text/template" + + "github.com/seeder-research/uMagNUS/engine" ) -var flag_vet = flag.Bool("vet", false, "only vet source files, don't run them") -var flag_examples = flag.Bool("examples", false, "run mumax3 examples") -var flag_forced = flag.Bool("forced", false, "force to re-run mumax3 examples") +var flag_examples = flag.Bool("examples", false, "run uMagNUS examples") +var flag_forced = flag.Bool("forced", false, "force to re-run uMagNUS examples") var flag_builddir = flag.String("builddir", "build", "build directory") var buildDir string @@ -100,12 +101,12 @@ func (s *State) Example(in string) string { // exec input file check(ioutil.WriteFile(s.infile(), []byte(in), 0666)) arg := "-v" - if *flag_vet { + if *engine.Flag_vet { arg = "-vet" } if _, err := os.Stat(s.outfile()); os.IsNotExist(err) || *flag_forced { - cmd("mumax3", "-cache", "/tmp", arg, s.infile()) + cmd("uMagNUS", "-cache", "/tmp", arg, s.infile()) } recordExamples(in, s.count) @@ -125,7 +126,7 @@ func recordExamples(input string, num int) { } func (s *State) Img(fname string) string { - cmd("mumax3-convert", "-png", "-arrows", "16", path.Join(s.outfile(), fname+".ovf")) + cmd("mumax3cl-convert", "-png", "-arrows", "16", path.Join(s.outfile(), fname+".ovf")) pngfile := path.Join(s.relativeOutfile(), fname+".png") return fmt.Sprintf(`
@@ -157,7 +158,7 @@ func (s *State) Output() string { for _, f := range files { if f == "table.txt" { - cmd("mumax3-plot", path.Join(s.outfile(), f)) + cmd("mumax3cl-plot", path.Join(s.outfile(), f)) } }