Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add makefile gxpkg new #856

Merged
merged 7 commits into from
Sep 15, 2023
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 23 additions & 2 deletions src/tools/gxpkg.ss
Original file line number Diff line number Diff line change
Expand Up @@ -238,8 +238,7 @@
name: name)
(create-template ".gitignore" gitignore-template)

;; TODO create Makefile template
;; ...
(create-template "Makefile" name: name)

(when maybe-link
(pkg-link maybe-link (current-directory))))
Expand Down Expand Up @@ -576,6 +575,28 @@ END
END
)

(def Makefile-template #<<END
ARCH := \\$(shell uname -m)
DOCKER_IMAGE := "gerbil/gerbilxx:\\$(ARCH)"
default: linux-static

build:
vyzo marked this conversation as resolved.
Show resolved Hide resolved
/opt/gerbil/bin/gxpkg link ${name} /src ||true
/opt/gerbil/bin/gxpkg build ${name}
vyzo marked this conversation as resolved.
Show resolved Hide resolved

linux-static:
docker run -it \
-e GERBIL_PATH=/src/.gerbil \
-v \\$(PWD):/src:z \
\\$(DOCKER_IMAGE) \
make -C /src/ build

install:
mv .gerbil/bin/${name} /usr/local/bin/${name}

END
)

(def build.ss-template #<<END
#!/usr/bin/env gxi
;;; -*- Gerbil -*-
Expand Down