forked from rene-dev/pixel
-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathMakefile
31 lines (21 loc) · 796 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# ============================= target: all =============================
CC = gcc
LDFLAGS = `pkg-config --libs sdl2` -lm -latomic -ldl -lpthread -lpng -O3 -flto -fomit-frame-pointer
CFLAGS = -Wall -Wextra -Wno-unused-parameter -pedantic -std=c11 -c `pkg-config --cflags sdl2` -O3 -flto -march=native -fomit-frame-pointer
# for macos:
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Darwin)
CFLAGS += -framework OpenGL
else
CFLAGS += -lGL
endif
all: pixelflut
pixelflut: main.o savepng.o
$(CC) -o pixelflut main.o savepng.o $(LDFLAGS)
main.o: main.c commandhandler.c framebuffer.c histogram.c server.c
$(CC) $(CFLAGS) $< -o $@
savepng.o: savepng.c savepng.h
$(CC) $(CFLAGS) $< -o $@
# ============================= clean =============================
clean:
rm -rf *.o pixelflut