Convert file indexing code in ui::input.
[Ale.git] / Makefile
blob38f52cee388daf19ef655a1f555143fbc5677c36
1 # Copyright 2002, 2003 David Hilvert <dhilvert@auricle.dyndns.org>,
2 # <dhilvert@ugcs.caltech.edu>
4 # This file is part of the Anti-Lamenessing Engine.
6 # The Anti-Lamenessing Engine is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 2 of the License, or
9 # (at your option) any later version.
11 # The Anti-Lamenessing Engine is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with Anti-Lamenessing Engine; if not, write to the Free Software
18 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 # Compile options (defaults)
24 IMAGEMAGICK=0
25 FFTW=0
26 DEBUG=0
27 POSIX=1
28 IOCTL=0
29 COLORS=SINGLE
30 COORDINATES=SINGLE
31 OPTIMIZATIONS=1
32 HASH_MAP=NONE
35 # Variable that is false when ImageMagick is not being used
38 use_imagemagick:=$(subst 0,,$(IMAGEMAGICK))
41 # Compiler flags
44 DEBUG_CFLAGS:=$(if $(subst 0,,$(DEBUG)),-DDEBUG,-DNDEBUG)
45 IMAGEMAGICK_CFLAGS:=$(if $(use_imagemagick),-DUSE_MAGICK $(shell Magick-config --cflags --cppflags),)
46 IMAGEMAGICK_LDFLAGS:=$(if $(use_imagemagick),$(shell Magick-config --ldflags --libs),)
47 FFTW_CFLAGS:=$(if $(subst 0,,$(FFTW)),-DUSE_FFTW,)
48 POSIX_CFLAGS:=$(if $(subst 0,,$(POSIX)),-DUSE_UNIX,)
49 IOCTL_CFLAGS:=$(if $(subst 0,,$(IOCTL)),-DUSE_IOCTL,)
50 PRECISION_CFLAGS:=$(if $(subst SINGLE,,$(COLORS)),,-DALE_COLORS=SINGLE)\
51 $(if $(subst DOUBLE,,$(COLORS)),,-DALE_COLORS=DOUBLE)\
52 $(if $(subst HALF,,$(COLORS)),,-DALE_COLORS=HALF)\
53 $(if $(subst SINGLE,,$(COORDINATES)),,-DALE_COORDINATES=SINGLE)\
54 $(if $(subst DOUBLE,,$(COORDINATES)),,-DALE_COORDINATES=DOUBLE)
55 FFTW_LDFLAGS:=$(if $(subst 0,,$(FFTW)),-lfftw3,)
56 OPTIMIZATION_CFLAGS:=-DOPTIMIZATIONS=$(OPTIMIZATIONS)
57 STL_CFLAGS:=$(if $(subst GNU,,$(HASH_MAP)),,-DHASH_MAP_GNU)\
58 $(if $(subst STD,,$(HASH_MAP)),,-DHASH_MAP_STD)
59 CFLAGS:= $(POSIX_CFLAGS) $(DEBUG_CFLAGS) $(FFTW_CFLAGS) $(PRECISION_CFLAGS) $(STL_CFLAGS)\
60 $(if $(use_imagemagick),$(IMAGEMAGICK_CFLAGS),-Wall -O2) \
61 $(OPTIMIZATION_CFLAGS) $(IOCTL_CFLAGS)
63 LDFLAGS:=$(if $(use_imagemagick),$(IMAGEMAGICK_LDFLAGS)) $(FFTW_LDFLAGS) -lm
66 # We're using 'ale-phony' because we're using make for configuration,
67 # and we want to make sure that the output is updated if the configuration
68 # changes.
70 # XXX: is there a better way to do this?
73 all: ale-phony
75 # ale: ale-phony
76 # @echo "Finished making ALE."
78 clean:
79 rm -f ale
80 rm -f ale.exe
81 rm -f ale.sum ale.log
82 find testsuite -name "*temp.*" | xargs rm -rf
83 find testsuite -name "*.output.*" | xargs rm -rf
85 ale-phony: ale.cc ui/ui.cc ui/input.cc d2.cc *.h d2/*.h d2/render/*.h d2/render/psf/*.h d3.cc d3/*.h
86 $(CXX) -o ale $(CFLAGS) ale.cc ui/ui.cc ui/input.cc d3.cc d2.cc $(LDFLAGS)
88 # The following approach to building a Windows binary is probably very
89 # dependent on the host platform configuration. The above target may be a
90 # better place to start for Windows users.
92 ale.exe: ale.cc ui/ui.cc ui/input.cc d2.cc *.h d2/*.h d2/render/*.h d2/render/psf/*.h d3.cc d3/*.h
93 i586-mingw32msvc-g++ -Wall $(OPTIMIZATION_CFLAGS) $(PRECISION_CFLAGS) $(DEBUG_CFLAGS) -o ale.exe -O2 ale.cc ui/ui.cc ui/input.cc d3.cc d2.cc -lm
96 # The following rules may require additional software to be installed.
99 ALE=./ale
101 check: # $(ALE)
102 runtest --tool ale ALE=$(ALE) --srcdir ./testsuite