yes there's a bit of java in my nvim config why do you ask?
This commit is contained in:
47
lua/snippets/make.lua
Normal file
47
lua/snippets/make.lua
Normal file
@ -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")
|
||||
})
|
||||
}
|
Reference in New Issue
Block a user