summaryrefslogtreecommitdiffstats
path: root/lua/snippets/make.lua
diff options
context:
space:
mode:
authorSquibid <me@zacharyscheiman.com>2024-08-09 02:45:31 -0400
committerSquibid <me@zacharyscheiman.com>2024-08-09 02:45:31 -0400
commitc489d393695e90d424f9ae51e35c4d42358e6a71 (patch)
tree12ea97ec4684fd82cd6b73dd127d0137b115837b /lua/snippets/make.lua
parentad76983d969c318e6e234bc82384b4b025d70447 (diff)
downloadnvim-c489d393695e90d424f9ae51e35c4d42358e6a71.tar.gz
nvim-c489d393695e90d424f9ae51e35c4d42358e6a71.tar.bz2
nvim-c489d393695e90d424f9ae51e35c4d42358e6a71.zip
yes there's a bit of java in my nvim config why do you ask?
Diffstat (limited to '')
-rw-r--r--lua/snippets/make.lua47
1 files changed, 47 insertions, 0 deletions
diff --git a/lua/snippets/make.lua b/lua/snippets/make.lua
new file mode 100644
index 0000000..fefdf92
--- /dev/null
+++ b/lua/snippets/make.lua
@@ -0,0 +1,47 @@
+require('core.snippets.shorthands')
+
+return {
+ -- basic make template snippet
+ s("make", {
+ t({ "PKG_CONFIG = pkg-config", "CC = cc", "VERSION = " }),
+ i(1, "0.1"),
+ t({ "", "", "# flags and incs", "PKGS = " }),
+ i(2),
+ t({ "", "CFLAGS = -DVERSION=\\\"$(VERSION)\\\" -Wall" }),
+ i(3),
+ t({ "", "LIBS = `$(PKG_CONFIG) --libs --cflags $(PKGS)`" }),
+ i(4),
+ t({ "", "", "PREFIX = " }),
+ i(5, "/usr/local"),
+ t({ "", "MANDIR = $(PREFIX)/share/man" }),
+ t({ "", "", "all: " }),
+ i(6, "main"),
+ t({ "", "" }),
+ rep(6),
+ t(": "),
+ rep(6),
+ t({ ".o", "\t$(CC) *.o $(CFLAGS) $(LIBS) -o $@", "" }),
+ rep(6),
+ t(".o: "),
+ rep(6),
+ t({ ".c", "", "clean:", "\trm -f " }),
+ rep(6),
+ t({ " *.o", "", "install: " }),
+ rep(6),
+ t({ "", "\tmkdir -p $(PREFIX)/bin", "\tcp -f " }),
+ rep(6),
+ t({ " $(PREFIX)/bin", "\tchmod 755 $(PREFIX)/bin/" }),
+ rep(6),
+ t({ "", "\tmkdir -p $(MANDIR)/man1", "\tcp -f " }),
+ rep(6),
+ t({ ".1 $(MANDIR)/man1", "\tchmod 644 $(MANDIR)/man1/" }),
+ rep(6),
+ t({ ".1", "", "uninstall: " }),
+ rep(6),
+ t({ "", "\trm -f $(PREFIX)/bin/" }),
+ rep(6),
+ t(" $(MANDIR)/man1/"),
+ rep(6),
+ t(".1")
+ })
+}