Skip to content

Commit

Permalink
added doc
Browse files Browse the repository at this point in the history
  • Loading branch information
xfong committed Apr 7, 2022
1 parent 097bed0 commit 4545535
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 16 deletions.
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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/...


Expand All @@ -27,7 +27,7 @@ hooks: .git/hooks/post-commit .git/hooks/pre-commit
ln -sf $(CURDIR)/$< $@


go.mod:
mod:
go mod init


Expand Down
13 changes: 7 additions & 6 deletions doc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
15 changes: 8 additions & 7 deletions doc/make.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand All @@ -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(`
<figure style="float:left">
Expand Down Expand Up @@ -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))
}
}

Expand Down

0 comments on commit 4545535

Please sign in to comment.