diff options
author | Luke Shumaker <lukeshu@lukeshu.com> | 2022-07-10 13:18:30 -0600 |
---|---|---|
committer | Luke Shumaker <lukeshu@lukeshu.com> | 2022-07-10 13:35:20 -0600 |
commit | 27401b6ea459921a6152ab1744da1618358465f4 (patch) | |
tree | 2c4f9c096f1a593e65d7f824901e815ca48bfaf0 /pkg/btrfs/Makefile | |
parent | 42f6f78e0a32ba0eda707154f8e1ffb4579604ee (diff) |
Rename the module, mv pkg lib
Diffstat (limited to 'pkg/btrfs/Makefile')
-rw-r--r-- | pkg/btrfs/Makefile | 79 |
1 files changed, 0 insertions, 79 deletions
diff --git a/pkg/btrfs/Makefile b/pkg/btrfs/Makefile deleted file mode 100644 index a770356..0000000 --- a/pkg/btrfs/Makefile +++ /dev/null @@ -1,79 +0,0 @@ -.DEFAULT_GOAL = all -.SECONDARY: -.DELETE_ON_ERROR: - -btrfsitem/items.txt: btrfsitem $(wildcard btrfsitem/item_*.go) $(MAKEFILE_LIST) - { \ - sed -En 's,^type (\S+) .* // (.*=.*),\1 \2,p' $(filter btrfsitem/item_%.go,$^) | while read -r typ keys; do \ - for key in $$keys; do \ - echo "$$key" "$$typ"; \ - done; \ - done; \ - } | LC_COLLATE=C sort >$@ -files += btrfsitem/items.txt - -btrfsitem/items_gen.go: btrfsitem/items.txt $(MAKEFILE_LIST) - { \ - echo '// Code generated by Make. DO NOT EDIT.'; \ - echo; \ - echo 'package $(@D)'; \ - echo 'import ('; \ - echo '"reflect"'; \ - echo; \ - echo '"lukeshu.com/btrfs-tools/pkg/btrfs/internal"'; \ - echo ')'; \ - echo 'const ('; \ - sed -E 's,(.*)=(.*) (.*),\1_KEY=internal.\1_KEY,' $<; \ - echo ')'; \ - echo 'var keytype2gotype = map[Type]reflect.Type{'; \ - sed -En 's|(.*)=([^:]*) (.*)|\1_KEY: reflect.TypeOf(\3{}),|p' $<; \ - echo '}'; \ - echo 'var untypedObjID2gotype = map[internal.ObjID]reflect.Type{'; \ - sed -En 's|UNTYPED=0:(.*) (.*)|internal.\1: reflect.TypeOf(\2{}),|p' $<; \ - echo '}'; \ - sed -En 's,(.*)=(.*) (.+),\3,p' $< | LC_COLLATE=C sort -u | sed 's,.*,func (&) isItem() {},'; \ - } | gofmt >$@ -files += btrfsitem/items_gen.go - -internal/itemtype.go: btrfsitem/items.txt $(MAKEFILE_LIST) - { \ - echo '// Code generated by Make. DO NOT EDIT.'; \ - echo; \ - echo 'package $(@D)'; \ - echo 'import "fmt"'; \ - echo 'type ItemType uint8'; \ - echo 'const ('; \ - sed -E 's,(.*)=([^:]*)(:.*)? (.*),\1_KEY=ItemType(\2),' $< | uniq; \ - echo ')'; \ - echo 'func (t ItemType) String() string {'; \ - echo ' names := map[ItemType]string{'; \ - sed -E 's@(.*)=(.*) (.*)@\1_KEY: "\1",@' $< | sed 's/"UUID_/&KEY_/'; \ - echo ' }'; \ - echo ' if name, ok := names[t]; ok {'; \ - echo ' return name'; \ - echo ' }'; \ - echo ' return fmt.Sprintf("%d", t)'; \ - echo '}'; \ - } | gofmt >$@ -files += internal/itemtype.go - -aliases_objid.go: internal/objid.go $(MAKEFILE_LIST) - { \ - echo '// Code generated by Make. DO NOT EDIT.'; \ - echo; \ - echo 'package btrfs'; \ - echo 'import ('; \ - echo '"lukeshu.com/btrfs-tools/pkg/btrfs/internal"'; \ - echo ')'; \ - echo 'const('; \ - sed -En 's/^\s*(\S*_OBJECTIDS?)\s*=.*/\1 = internal.\1/p' <$<; \ - echo ')'; \ - } | gofmt >$@ -files += aliases_objid.go - -all: $(files) -.PHONY: all - -clean: - rm -f -- $(files) -.PHONY: all |