Reorganize build system

This commit is contained in:
Brandon Dyck 2024-06-09 22:50:33 -06:00
parent 98c839f868
commit 3e15c4b047
4 changed files with 19 additions and 16 deletions

3
.gitignore vendored
View File

@ -1,3 +1,2 @@
redbean*.com
*.db *.db
.build build

View File

@ -1,16 +1,21 @@
.PHONY: build/peachy.com
build/peachy.com: build/redbean-2.2.com
cp build/redbean-2.2.com build/peachy-noassets.com
cd assets ; zip -r ../build/peachy-noassets.com . ; cd ..
mv build/peachy-noassets.com build/peachy.com
.PHONY: run .PHONY: run
run: .build/peachy.com run: build/peachy.com
.build/peachy.com build/peachy.com
.PHONY: .build/peachy.com build/redbean-2.2.com:
.build/peachy.com: redbean/redbean-2.2.com wget --directory-prefix build https://redbean.dev/redbean-2.2.com
mkdir -p .build chmod a+x build/redbean-2.2.com
# rm .build/*
cp redbean/redbean-2.2.com .build/peachy-noassets.com
zip -r .build/peachy-noassets.com .init.lua .lua
mv .build/peachy-noassets.com .build/peachy.com
.PHONY: clean
clean:
rm build/peachy*
.redbean/redbean-2.2.com: .PHONY: clean-redbean
wget --directory-prefix redbean https://redbean.dev/redbean-2.2.com clean-redbean:
chmod a+x redbean/redbean-2.2.com rm build/redbean*

View File

@ -1,4 +1,4 @@
LaunchBrowser() -- LaunchBrowser()
fm = require "fullmoon" fm = require "fullmoon"
fm.setTemplate("hello", "Hello, {%& name %}") fm.setTemplate("hello", "Hello, {%& name %}")
@ -7,5 +7,4 @@ fm.setRoute("/hello/:name", function(r)
end) end)
fm.setTemplate("itworks", "<h1>It works!</h1>") fm.setTemplate("itworks", "<h1>It works!</h1>")
fm.setRoute("/", fm.serveContent("itworks")) fm.setRoute("/", fm.serveContent("itworks"))
print "did some stuff"
fm.run() fm.run()