Initial commit
This commit is contained in:
33
Makefile
Normal file
33
Makefile
Normal file
@@ -0,0 +1,33 @@
|
||||
TARGET_EXEC:=sm
|
||||
|
||||
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 -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/sm.rc
|
||||
# @echo "Generating Windows resources"
|
||||
# @$(WINDRES) $< -O coff -o $@
|
||||
|
||||
clean: clean_obj
|
||||
clean_obj:
|
||||
@$(RM) $(OBJS) $(TARGET_EXEC)
|
||||
Reference in New Issue
Block a user