source: trunk/orbital/Makefile.am @ 1479

Last change on this file since 1479 was 1479, checked in by sam, 9 years ago

build: simplify the .lolfx file compilation.

File size: 1.5 KB
Line 
1
2noinst_PROGRAMS = orbital
3
4orbital_SOURCES = \
5    orbital.cpp orbital.h \
6    particlesystem.h tank.h player.h gun.h snake.h starfield.h \
7    \
8    shiny.lolfx \
9    \
10    mesh.cpp mesh.h mesh-compiler.cpp mesh-compiler.h \
11    generated/mesh-scanner.cpp generated/mesh-parser.cpp \
12    \
13    gun.cpp gun.h gun-compiler.cpp gun-compiler.h \
14    generated/gun-scanner.cpp generated/gun-parser.cpp
15orbital_CPPFLAGS = @LOL_CFLAGS@ @PIPI_CFLAGS@
16orbital_LDADD =
17orbital_LDFLAGS = $(top_builddir)/src/liblol.a @LOL_LIBS@ @PIPI_LIBS@
18orbital_DEPENDENCIES = $(top_builddir)/src/liblol.a
19
20all-local: orbital$(EXEEXT)
21        test $(MAKE_FSELF) = no || make_fself orbital$(EXEEXT) orbital.self
22
23if TRUE
24generated: .FORCE
25        $(MKDIR_P) generated
26        rm -f generated/[a-zA-Z]*
27        flex -o generated/mesh-scanner.cpp mesh-scanner.l
28        flex -o generated/gun-scanner.cpp gun-scanner.l
29        bison -o generated/mesh-parser.cpp --defines=generated/mesh-parser.h \
30              -d -b generated/mesh mesh-parser.y
31        bison -o generated/gun-parser.cpp --defines=generated/gun-parser.h \
32              -d -b generated/gun gun-parser.y
33.FORCE:
34endif
35
36EXTRA_DIST = mesh-scanner.l mesh-parser.y \
37             gun-scanner.l gun-parser.y
38CLEANFILES = $(noinst_PROGRAMS:%$(EXEEXT)=%.self) \
39             $(noinst_PROGRAMS:%$(EXEEXT)=%.elf) \
40             $(noinst_PROGRAMS:%$(EXEEXT)=%.exe)
41
42SUFFIXES = .lolfx
43.lolfx.o:
44        (echo "char const *"; \
45         echo "lolfx_$(notdir $(basename $(filter %.lolfx, $^))) ="; \
46         $(SED) 's/"/\\"/g' $(filter %.lolfx, $^) | \
47         $(SED) 's/\([^\r]*\).*/"\1\\n"/'; \
48         echo ";") | $(CXXCOMPILE) -xc++ -c - -o $@
49
Note: See TracBrowser for help on using the repository browser.