use Makefile for dependency building instead of go generate

This commit is contained in:
Jeffrey Morgan 2023-07-06 10:59:21 -04:00
parent e423421f03
commit 9fe018675f
4 changed files with 19 additions and 5 deletions

1
.gitignore vendored
View file

@ -7,3 +7,4 @@ build
dist
__pycache__
ollama
ggml-metal.metal

18
Makefile Normal file
View file

@ -0,0 +1,18 @@
default: ollama
.PHONY: llama
llama:
cmake -S llama -B llama/build -DLLAMA_METAL=on
cmake --build llama/build
.PHONY: ollama
ollama: llama
go build .
.PHONY: app
app: ollama
npm run --prefix app package
clean:
go clean
rm -rf llama/build

View file

@ -20,8 +20,6 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
//go:generate cmake -S . -B build
//go:generate cmake --build build
package llama
// #cgo LDFLAGS: -Lbuild -lbinding -lllama -lm -lggml_static -lstdc++

View file

@ -1,5 +1,2 @@
//go:build metal
package llama
//go:generate cmake -S . -B build --fresh -DLLAMA_METAL=on
//go:generate cmake --build build