Support stream compression
[lsnes.git] / Makefile
blobb6fcb6eae0f226eadb03b37a44bd2d12c788f4d8
1 OPTIONS=options.build
2 include $(OPTIONS)
4 ifndef LUA
5 LUA=lua
6 endif
8 #Compilers.
9 REALCC = $(CROSS_PREFIX)$(CC)
10 REALLD = $(CROSS_PREFIX)$(LD)
11 REALRANLIB = $(CROSS_PREFIX)$(RANLIB)
13 #Flags.
14 HOSTCCFLAGS = -std=gnu++0x
15 CFLAGS += -std=gnu++0x $(USER_CFLAGS)
16 ifdef BOOST_NEEDS_MT
17 BOOST_LIB_POSTFIX=-mt
18 else
19 BOOST_LIB_POSTFIX=
20 endif
22 LDFLAGS = -lboost_iostreams$(BOOST_LIB_POSTFIX) -lboost_filesystem$(BOOST_LIB_POSTFIX) -lboost_system$(BOOST_LIB_POSTFIX) -lboost_regex$(BOOST_LIB_POSTFIX) -lz $(USER_LDFLAGS) -lcurl
24 ifeq ($(THREADS), NATIVE)
25 CFLAGS += -DNATIVE_THREADS
26 else
27 ifeq ($(THREADS), BOOST)
28 CFLAGS += -DBOOST_THREADS
29 LDFLAGS += -lboost_thread$(BOOST_LIB_POSTFIX)
30 else
31 $(error "Bad value for THREADS (expected NATIVE or BOOST)")
32 endif
33 endif
35 ifdef USE_LIBGCRYPT
36 CFLAGS += -DUSE_LIBGCRYPT_SHA256
37 LDFLAGS += -lgcrypt -lgpg-error
38 endif
40 ifdef USE_LIBLZMA
41 CFLAGS += -DLIBLZMA_AVAILABLE
42 LDFLAGS += -llzma
43 endif
45 ifeq ($(ARCHITECTURE), I386)
46 CFLAGS += -DARCH_IS_I386
47 else
48 endif
51 export
53 all: src/__all_files__
55 CFLAGS += $(shell $(CROSS_PREFIX)pkg-config $(LUA) --cflags)
56 LDFLAGS += $(shell $(CROSS_PREFIX)pkg-config $(LUA) --libs)
58 compiler=$(subst ++,cc,$(REALCC))
59 gambatte_compiler=$(REALCC)
61 bsnes/out/libsnes.$(ARCHIVE_SUFFIX): forcelook
62 $(MAKE) -C bsnes $(BSNES_PROFILE_STRING) $(BSNES_TARGET_STRING)
63 $(REALRANLIB) bsnes/out/libsnes.$(ARCHIVE_SUFFIX)
66 src/__all_files__: src/core/version.cpp forcelook
67 $(MAKE) -C src precheck
68 $(MAKE) -C src
69 cp src/lsnes$(DOT_EXECUTABLE_SUFFIX) .
71 buildaux/version.exe: buildaux/version.cpp VERSION
72 $(HOSTCC) $(HOSTCCFLAGS) -o $@ $<
73 src/core/version.cpp: buildaux/version.exe forcelook
74 buildaux/version.exe >$@
77 clean:
78 $(MAKE) -C src clean
80 forcelook:
81 @true