Mercurial > repos > blastem
comparison Makefile @ 747:85c98a222fea
Merge
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Thu, 28 May 2015 23:05:32 -0700 |
parents | 9d4d40f833d0 |
children | 6f439a197f61 |
comparison
equal
deleted
inserted
replaced
740:25c9e9d39997 | 747:85c98a222fea |
---|---|
1 ifndef OS | 1 ifndef OS |
2 OS:=$(shell uname -s) | 2 OS:=$(shell uname -s) |
3 endif | 3 endif |
4 | |
5 ifeq ($(OS),Windows) | |
6 CC:=wine gcc.exe | |
7 | |
8 MEM:=mem_win.o | |
9 BLASTEM:=blastem.exe | |
10 | |
11 CC:=wine gcc.exe | |
12 CFLAGS:=-O2 -std=gnu99 -Wreturn-type -Werror=return-type -Werror=implicit-function-declaration -I"C:/MinGW/usr/include/SDL2" -DGLEW_STATIC | |
13 LDFLAGS:= -L"C:/MinGW/usr/lib" -lm -lmingw32 -lSDL2main -lSDL2 -lopengl32 -lglu32 -mwindows | |
14 CPU:=i686 | |
15 | |
16 else | |
17 | |
18 MEM:=mem.o | |
19 BLASTEM:=blastem | |
4 | 20 |
5 ifeq ($(OS),Darwin) | 21 ifeq ($(OS),Darwin) |
6 LIBS=sdl2 glew | 22 LIBS=sdl2 glew |
7 else | 23 else |
8 LIBS=sdl2 glew gl | 24 LIBS=sdl2 glew gl |
9 endif | 25 endif #Darwin |
10 | 26 |
11 ifdef DEBUG | 27 ifdef DEBUGW |
12 CFLAGS:=-ggdb -std=gnu99 $(shell pkg-config --cflags-only-I $(LIBS)) -Wreturn-type -Werror=return-type -Werror=implicit-function-declaration | 28 CFLAGS:=-ggdb -std=gnu99 $(shell pkg-config --cflags-only-I $(LIBS)) -Wreturn-type -Werror=return-type -Werror=implicit-function-declaration |
13 LDFLAGS:=-ggdb -lm $(shell pkg-config --libs $(LIBS)) | 29 LDFLAGS:=-ggdb -lm $(shell pkg-config --libs $(LIBS)) |
14 else | 30 else |
15 CFLAGS:=-O2 -flto -std=gnu99 $(shell pkg-config --cflags-only-I $(LIBS)) -Wreturn-type -Werror=return-type -Werror=implicit-function-declaration | 31 CFLAGS:=-O2 -flto -std=gnu99 $(shell pkg-config --cflags-only-I $(LIBS)) -Wreturn-type -Werror=return-type -Werror=implicit-function-declaration |
16 LDFLAGS:=-O2 -flto -lm $(shell pkg-config --libs $(LIBS)) | 32 LDFLAGS:=-O2 -flto -lm $(shell pkg-config --libs $(LIBS)) |
17 endif | 33 endif #DEBUG |
34 endif #Windows | |
18 | 35 |
19 ifdef Z80_LOG_ADDRESS | 36 ifdef Z80_LOG_ADDRESS |
20 CFLAGS+= -DZ80_LOG_ADDRESS | 37 CFLAGS+= -DZ80_LOG_ADDRESS |
21 endif | 38 endif |
22 | 39 |
44 | 61 |
45 ifeq ($(OS),Darwin) | 62 ifeq ($(OS),Darwin) |
46 LDFLAGS+= -framework OpenGL | 63 LDFLAGS+= -framework OpenGL |
47 endif | 64 endif |
48 | 65 |
49 TRANSOBJS=gen.o backend.o mem.o | 66 TRANSOBJS=gen.o backend.o $(MEM) |
50 M68KOBJS=68kinst.o m68k_core.o | 67 M68KOBJS=68kinst.o m68k_core.o |
51 ifeq ($(CPU),x86_64) | 68 ifeq ($(CPU),x86_64) |
52 M68KOBJS+= m68k_core_x86.o | 69 M68KOBJS+= m68k_core_x86.o |
53 TRANSOBJS+= gen_x86.o backend_x86.o | 70 TRANSOBJS+= gen_x86.o backend_x86.o |
54 else | 71 else |
78 CFLAGS+=-DNO_Z80 | 95 CFLAGS+=-DNO_Z80 |
79 else | 96 else |
80 MAINOBJS+= $(Z80OBJS) | 97 MAINOBJS+= $(Z80OBJS) |
81 endif | 98 endif |
82 | 99 |
100 ifeq ($(OS),Windows) | |
101 MAINOBJS+= glew32s.lib | |
102 endif | |
83 | 103 |
84 all : dis zdis stateview vgmplay blastem | 104 all : dis zdis stateview vgmplay blastem |
85 | 105 |
86 blastem : $(MAINOBJS) | 106 $(BLASTEM) : $(MAINOBJS) |
87 $(CC) -o blastem $(MAINOBJS) $(LDFLAGS) | 107 $(CC) -o $(BLASTEM) $(MAINOBJS) $(LDFLAGS) |
88 | 108 |
89 dis : dis.o 68kinst.o tern.o vos_program_module.o | 109 dis : dis.o 68kinst.o tern.o vos_program_module.o |
90 $(CC) -o dis dis.o 68kinst.o tern.o vos_program_module.o | 110 $(CC) -o dis dis.o 68kinst.o tern.o vos_program_module.o |
91 | 111 |
92 zdis : zdis.o z80inst.o | 112 zdis : zdis.o z80inst.o |