summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile30
1 files changed, 25 insertions, 5 deletions
diff --git a/Makefile b/Makefile
index ca09d69..b3e966b 100644
--- a/Makefile
+++ b/Makefile
@@ -2,19 +2,36 @@ ifndef OS
OS:=$(shell uname -s)
endif
+ifeq ($(OS),Windows)
+CC:=wine gcc.exe
+
+MEM:=mem_win.o
+BLASTEM:=blastem.exe
+
+CC:=wine gcc.exe
+CFLAGS:=-O2 -std=gnu99 -Wreturn-type -Werror=return-type -Werror=
+LDFLAGS:= -L"C:/MinGW/usr/lib" -lm -lmingw32 -lSDLmain -lSDL -mwindows
+CPU:=i686
+
+else
+
+MEM:=mem.o
+BLASTEM:=blastem
+
ifeq ($(OS),Darwin)
LIBS=sdl2 glew
else
LIBS=sdl2 glew gl
-endif
+endif #Darwin
-ifdef DEBUG
+ifdef DEBUGW
CFLAGS:=-ggdb -std=gnu99 $(shell pkg-config --cflags-only-I $(LIBS)) -Wreturn-type -Werror=return-type -Werror=implicit-function-declaration
LDFLAGS:=-ggdb -lm $(shell pkg-config --libs $(LIBS))
else
CFLAGS:=-O2 -flto -std=gnu99 $(shell pkg-config --cflags-only-I $(LIBS)) -Wreturn-type -Werror=return-type -Werror=implicit-function-declaration
LDFLAGS:=-O2 -flto -lm $(shell pkg-config --libs $(LIBS))
-endif
+endif #DEBUG
+endif #Windows
ifdef Z80_LOG_ADDRESS
CFLAGS+= -DZ80_LOG_ADDRESS
@@ -80,11 +97,14 @@ else
MAINOBJS+= $(Z80OBJS)
endif
+ifdef WINDOWS
+MAINOBJS+= glew32s.lib
+endif
all : dis zdis stateview vgmplay blastem
-blastem : $(MAINOBJS)
- $(CC) -o blastem $(MAINOBJS) $(LDFLAGS)
+$(BLASTEM) : $(MAINOBJS)
+ $(CC) -o $(BLASTEM) $(MAINOBJS) $(LDFLAGS)
dis : dis.o 68kinst.o tern.o vos_program_module.o
$(CC) -o dis dis.o 68kinst.o tern.o vos_program_module.o