32 lines
450 B
Plaintext
32 lines
450 B
Plaintext
|
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
|