forked from yui0/waifu2x-glsl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
43 lines (36 loc) · 1011 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
32
33
34
35
36
37
38
39
40
41
42
43
# ©2017-2018 YUICHIRO NAKADA
PROGRAM = waifu2x_glsl
CC = clang
CPP = clang++
#CFLAGS = -Ofast -march=native -funroll-loops -mf16c -DDEBUG
CFLAGS = -Ofast -march=native -funroll-loops -mf16c
CPPFLAGS= $(CFLAGS)
LDFLAGS = -lm
CSRC = $(wildcard *.c)
CPPSRC = $(wildcard *.cpp)
DEPS = $(wildcard *.h) Makefile
OBJS = $(patsubst %.c,%.o,$(CSRC)) $(patsubst %.cpp,%.o,$(CPPSRC))
#USE_GLES:= 1
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Linux)
#CC := $(shell [ -x /usr/bin/diet ] && echo diet clang)
ifeq ($(USE_GLES),1)
CFLAGS += `pkg-config --cflags glesv2 egl gbm` -DGPGPU_USE_GLES
LDFLAGS += `pkg-config --libs glesv2 egl gl gbm`
else
CFLAGS += `pkg-config --cflags gl`
LDFLAGS += `pkg-config --libs gl` -lglfw
endif
endif
ifeq ($(UNAME_S),Darwin)
LDFLAGS += -framework OpenGL -lglfw
endif
%.o: %.cpp $(DEPS)
$(CPP) -c -o $@ $< $(CPPFLAGS)
%.o: %.c $(DEPS)
$(CC) -c -o $@ $< $(CFLAGS)
$(PROGRAM): $(OBJS)
$(CPP) -o $@ $^ -s $(LDFLAGS)
.PHONY: clean
clean:
$(RM) $(PROGRAM) $(OBJS) *.o *.s