-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile.common
41 lines (35 loc) · 982 Bytes
/
Makefile.common
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
LIBDIR = $(TOPDIR)/lib
MAKE = make
CC = gcc
CXX = g++
UNAME=$(shell uname)
ifeq ($(UNAME),Darwin)
ARCH=$(shell arch)
ifeq ($(ARCH),arm64)
PKGCONFIG = /opt/homebrew/bin/pkg-config
else
PKGCONFIG = /usr/local/bin/pkg-config
endif
CC = gcc
CXX = g++
LIBEXT = dylib
LDFLAGS = -L$(LIBDIR) -lpthread
CFLAGS = -g -ggdb -Wall -O3 -D_THREAD_SAFE -std=c2x
CFLAGS += -D_BSD_SOURCE -ferror-limit=5
CFLAGS += $(shell $(PKGCONFIG) --cflags sdl2)
CFLAGS += -I$(TOPDIR)
CXXFLAGS := $(CFLAGS)
#CFLAGS += -Wno-deprecated -Wconversion -Werror -Wno-unused-function
else
PKGCONFIG = $(shell which pkg-config)
CC = gcc
CXX = g++
LIBEXT = so
LDFLAGS = -L$(LIBDIR) -lm -lpthread
CFLAGS = -g -ggdb -Wall -O3 -D_THREAD_SAFE -std=c2x
CFLAGS += -D_XOPEN_SOURCE=500 -fmax-errors=5
CFLAGS += $(shell $(PKGCONFIG) --cflags sdl2)
CFLAGS += -I$(TOPDIR)
CXXFLAGS := $(CFLAGS)
CFLAGS += -Wno-deprecated -Wconversion -Werror -Wno-unused-function
endif