forked from snesrev/smw
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
33 lines (25 loc) · 838 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
TARGET_EXEC:=smw
SRCS:=$(wildcard src/*.c src/snes/*.c) third_party/gl_core/gl_core_3_1.c
OBJS:=$(SRCS:%.c=%.o)
PYTHON:=/usr/bin/env python3
CFLAGS:=$(if $(CFLAGS),$(CFLAGS),-O2 -fno-strict-aliasing -Werror )
CFLAGS:=${CFLAGS} $(shell sdl2-config --cflags) -DSYSTEM_VOLUME_MIXER_AVAILABLE=0 -I.
ifeq (${OS},Windows_NT)
WINDRES:=windres
# RES:=sm.res
SDLFLAGS:=-Wl,-Bstatic $(shell sdl2-config --static-libs)
else
SDLFLAGS:=$(shell sdl2-config --libs) -lm
endif
.PHONY: all clean clean_obj
all: $(TARGET_EXEC)
$(TARGET_EXEC): $(OBJS) $(RES)
$(CC) $^ -o $@ $(LDFLAGS) $(SDLFLAGS)
%.o : %.c
$(CC) -c $(CFLAGS) $< -o $@
#$(RES): src/platform/win32/smw.rc
# @echo "Generating Windows resources"
# @$(WINDRES) $< -O coff -o $@
clean: clean_obj
clean_obj:
@$(RM) $(OBJS) $(TARGET_EXEC)