dotfiles/vim/.vim/UltiSnips/make.snippets

32 lines
450 B
Plaintext
Raw Normal View History

2024-01-03 11:04:20 +01:00
snippet base "tonitch's makefile base" b
.PHONY: all clean run
VERSION = 0.0.1
LIBS =
CMACRO = -DVERSION=\"$(VERSION)\"
CC = gcc
CFLAGS = -g -Wall -Wextra -pedantic $(shell pkg-config $(LIBS) --cflags) $(CMACRO)
LDFLAGS = $(shell pkg-config $(LIBS) --libs)
all: main
main: main.o
$(CC) $(CFLAGS) -o $@ $< $(LDFLAGS)
%.o: %.c
$(CC) $(CFLAGS) -c -o $@ $<
clean:
rm -f *.o
rm -f main
bear: clean
bear -- make
run: main
./$<
endsnippet