lsnes rr0-β2
[lsnes.git] / Makefile
blob1992b0a4bed78935f7fb4cd932e8d8e74a986cc6
1 FONT_SRC := unifontfull-5.1.20080820.hex
2 CC := g++-4.5
3 HOSTCC = $(CC)
4 OBJECTS = controllerdata.o memorymanip.o misc.o movie.o moviefile.o render.o rom.o zip.o fonts/font.o keymapper.o window.o window-sdl.o settings.o framerate.o mainloop.o rrdata.o png.o lsnesrc.o memorywatch.o command.o avsnoop.o moviedata.o controller.o framebuffer.o
6 #AVI dumper
7 OBJECTS += avidump/avidump-control.o avidump/avidump.o avidump/sox.o
9 PROGRAMS = lsnes.exe
11 CFLAGS = -I. $(shell sdl-config --cflags) $(USER_CFLAGS)
12 HOSTCCFLAGS = $(USER_HOSTCCFLAGS)
13 LDFLAGS = $(shell sdl-config --libs) $(USER_LDFLAGS)
15 #Lua.
16 ifdef NO_LUA
17 OBJECTS += lua-dummy.o
18 else
19 OBJECTS += lua.o $(patsubst %.cpp,%.o,$(wildcard lua/*.cpp))
20 CFLAGS += $(shell pkg-config lua5.1 --cflags)
21 LDFLAGS += $(shell pkg-config lua5.1 --libs)
22 endif
25 ifdef NO_THREADS
26 CFLAGS += -DNO_THREADS
27 endif
29 ifdef BSNES_IS_COMPAT
30 CFLAGS += -DBSNES_IS_COMPAT
31 endif
34 all: $(PROGRAMS)
36 .PRECIOUS: %.exe %.o
38 %.exe: %.o $(OBJECTS)
39 $(CC) -o $@ $^ $(BSNES_PATH)/out/libsnes.a -ldl -lboost_iostreams -lboost_filesystem -lboost_system -lz $(LDFLAGS)
41 %.o: %.cpp
42 $(CC) -I. -g -std=c++0x -I$(BSNES_PATH) -c -o $@ $< $(CFLAGS)
44 fonts/font.o: fonts/$(FONT_SRC) fonts/parsehexfont.exe
45 fonts/parsehexfont.exe <fonts/$(FONT_SRC) >fonts/font.cpp
46 $(HOSTCC) -std=c++0x $(HOSTCCFLAGS) -c -o fonts/font.o fonts/font.cpp
47 $(HOSTCC) -std=c++0x $(HOSTCCFLAGS) -o fonts/verifyhexfont.exe fonts/verifyhexfont.cpp fonts/font.o
48 fonts/verifyhexfont.exe
50 fonts/parsehexfont.exe: fonts/parsehexfont.cpp
51 $(HOSTCC) -std=c++0x $(HOSTCCFLAGS) -o $@ $^
53 clean:
54 rm -f fonts/font.o fonts/font.cpp fonts/verifyhexfont.exe fonts/parsehexfont.exe $(OBJECTS) romtest1.o $(PROGRAMS) lsnes.o