-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
48 lines (37 loc) · 1.46 KB
/
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
44
45
46
47
48
CC = gcc
# used for the examples
CFLAGS =
LIBS := -static -lgdi32 -lm -lopengl32 -lwinmm -ggdb
EXT = .exe
#WARNINGS = -Wall -Werror -Wstrict-prototypes -Wextra -Wstrict-prototypes -Wold-style-definition -Wno-missing-field-initializers -Wno-unknown-pragmas -Wno-unused-parameter -Wno-unused-but-set-variable -Wno-missing-braces -Wno-missing-variable-declarations -Wno-redundant-decls -Wno-unused-function -Wno-unused-label -Wno-unused-result -Wno-incompatible-pointer-types -Wno-format -Wno-format-extra-args -Wno-implicit-function-declaration -Wno-implicit-int -Wno-pointer-sign -Wno-switch -Wno-switch-default -Wno-switch-enum -Wno-unused-value -Wno-type-limits
OS_DIR = \\
detected_OS = windows
ROM := TETRIS.ch8
# not using a cross compiler
ifeq (,$(filter $(CC),x86_64-w64-mingw32-gcc i686-w64-mingw32-gcc x86_64-w64-mingw32-g++ /opt/msvc/bin/x64/cl.exe /opt/msvc/bin/x86/cl.exe))
detected_OS := $(shell uname 2>/dev/null || echo Unknown)
ifeq ($(detected_OS),Darwin) # Mac OS X
LIBS := -lm -framework Foundation -framework AppKit -framework OpenGL -framework CoreVideo
EXT =
OS_DIR = /
endif
ifeq ($(detected_OS),Linux)
LIBS := -lXrandr -lX11 -lm -lGL -ldl -lpthread
EXT =
OS_DIR = /
endif
else
OS_DIR = /
endif
rgfw-c8: main.c RGFW.h util.h
$(CC) $< $(LIBS) $(WARNINGS) -o $@
clean:
rm -f rgfw-c8
ROMS := $(wildcard roms/*.ch8)
debug: rgfw-c8
make clean
make
@for rom in $(ROMS); do \
echo "Running $$rom..."; \
./rgfw-c8 $$rom; \
done