Makefile 1012 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. FENNEL = /usr/bin/fennel
  2. LUASTATIC = /usr/bin/luastatic
  3. LIB_LUA_STATIC = /usr/lib/liblua.a
  4. LUA_INCLUDE = /usr/include/
  5. ARCH := $(shell uname -m)
  6. all: config qire.lua qire
  7. .PHONY: all
  8. qire.lua: qire.fnl
  9. $(FENNEL) --compile qire.fnl > qire.lua
  10. config: base-config
  11. cp base-config config
  12. echo "repo dragora-$(ARCH) http://rsync.dragora.org/testing/packages/$(ARCH)/" >> config
  13. # on macOS: $(LUASTATIC) qire.lua str.lua list.lua iteration.lua tbl.lua -llua5.3 -I/usr/local/include/lua5.3
  14. qire: base-config qire.lua
  15. $(LUASTATIC) qire.lua $(LIB_LUA_STATIC) -I$(LUA_INCLUDE) -static
  16. install: config qire
  17. mkdir -p $(DESTDIR)/var
  18. mkdir -p $(DESTDIR)/var/cache
  19. mkdir -p $(DESTDIR)/var/cache/qire
  20. mkdir -p $(DESTDIR)$(PREFIX)/bin
  21. cp -f qire $(DESTDIR)$(PREFIX)/bin
  22. chmod 755 $(DESTDIR)$(PREFIX)/bin/qire
  23. mkdir -p $(DESTDIR)/etc
  24. mkdir -p $(DESTDIR)/etc/qire
  25. cp -f config $(DESTDIR)/etc/qire/qirerc
  26. uninstall:
  27. rm -f $(DESTDIR)$(PREFIX)/bin/qire
  28. rm -rf $(DESTDIR)/etc/qire
  29. clean:
  30. rm config qire.lua qire