29 lines
408 B
Makefile
29 lines
408 B
Makefile
.PHONY: all clean run
|
|
VERSION = 0.0.1
|
|
|
|
LIBS = sdl2
|
|
CMACRO = -DVERSION=\"$(VERSION)\"
|
|
|
|
CC = gcc
|
|
CFLAGS = -g -Wall -Wextra -pedantic $(shell pkg-config $(LIBS) --cflags) $(CMACRO)
|
|
LDFLAGS = $(shell pkg-config $(LIBS) --libs) -lm
|
|
|
|
all: pong
|
|
|
|
pong: pong.o
|
|
$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS)
|
|
|
|
%.o: %.c
|
|
$(CC) $(CFLAGS) -c -o $@ $<
|
|
|
|
clean:
|
|
rm -f *.o
|
|
rm -f pong
|
|
|
|
bear: clean
|
|
bear -- make
|
|
|
|
run: pong
|
|
./$<
|
|
|