-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
85 lines (68 loc) · 2.55 KB
/
Makefile
File metadata and controls
85 lines (68 loc) · 2.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
########################################
#
# build parameters
#
########################################
# installation prefix
PREFIX=/usr
########################################
#
# do not modify rest of this file
#
########################################
OPTIMIZE=#-O6 -march=pentium4 -mfpmath=sse -fomit-frame-pointer -funroll-loops
PROFILER=#-pg
DEBUG=-ggdb
CXXFLAGS+=-pipe -Wall $(OPTIMIZE) $(DEBUG) `sdl2-config --cflags` -DPREFIX=L\"$(PREFIX)\" $(PROFILER)
LNFLAGS+=-pipe $(PROFILER)
LIBS=-lSDL2_ttf -lfreetype `sdl2-config --libs` -lz -lSDL2_mixer
INSTALL=install
ifdef WASM
COMP=emcc
COMPFLAGS=-v -sUSE_ZLIB=1 -sUSE_SDL=2 -sUSE_SDL_TTF=2 -flto -Os -sDYNAMIC_EXECUTION=0 -sASYNCIFY -use-port=sdl2_image:formats=bmp --shell-file shell_minimal.html --embed-file res/einstein.res --minify 0 $(CXXFLAGS)
TARGET=einstein.html
else
COMP=$(CXX)
COMPFLAGS=$(CXXFLAGS)
TARGET=einstein
endif
SOURCES=puzgen.cpp main.cpp screen.cpp resources.cpp utils.cpp game.cpp \
widgets.cpp iconset.cpp puzzle.cpp rules.cpp \
verthins.cpp horhints.cpp menu.cpp font.cpp \
storage.cpp tablestorage.cpp regstorage.cpp \
topscores.cpp opensave.cpp descr.cpp options.cpp messages.cpp \
formatter.cpp buffer.cpp unicode.cpp convert.cpp table.cpp \
i18n.cpp lexal.cpp streams.cpp tokenizer.cpp sound.cpp
OBJECTS=puzgen.o main.o screen.o resources.o utils.o game.o \
widgets.o iconset.o puzzle.o rules.o verthints.o \
horhints.o menu.o font.o storage.o options.o \
tablestorage.o regstorage.o topscores.o opensave.o descr.o \
messages.o formatter.o buffer.o unicode.o convert.o table.o \
i18n.o lexal.o streams.o tokenizer.o sound.o
HEADERS=screen.h main.h exceptions.h resources.h utils.h \
widgets.h iconset.h puzzle.h verthints.h horhints.h \
font.h storage.h tablestorage.h regstorage.h \
topscores.h opensave.h game.h descr.h options.h messages.h \
foramtter.h buffer.h visitor.h unicode.h convert.h table.h \
i18n.h lexal.h streams.h tokenizer.h sound.h
.cpp.o:
$(COMP) $(COMPFLAGS) -c $<
all: $(TARGET)
$(TARGET): $(OBJECTS) res/einstein.res
$(COMP) $(COMPFLAGS) $(LNFLAGS) $(OBJECTS) -o $(TARGET) $(LIBS) $(LDFLAGS)
res/einstein.res: mkres/mkres
cd res && ../mkres/mkres --source resources.descr --output einstein.res
mkres/mkres:
$(MAKE) -C mkres mkres
cleanall: clean
cd res && rm -f einstein.res
cd mkres && make clean
clean:
rm -f $(OBJECTS) core* *core $(TARGET) *~
depend:
@makedepend $(SOURCES) 2> /dev/null
run: $(TARGET)
./$(TARGET)
install: $(TARGET)
$(INSTALL) -s -D $(TARGET) $(DESTDIR)/$(PREFIX)/games/$(TARGET)
# DO NOT DELETE THIS LINE -- make depend depends on it.