Переглянути джерело

build: simplify the .lolfx file compilation.

legacy
Sam Hocevar sam 12 роки тому
джерело
коміт
6f73cafa08
3 змінених файлів з 19 додано та 27 видалено
  1. +0
    -1
      .gitignore
  2. +9
    -12
      src/Makefile.am
  3. +10
    -14
      test/tutorial/Makefile.am

+ 0
- 1
.gitignore Переглянути файл

@@ -73,4 +73,3 @@ test/math/remez
test/xolotl/xolotl
tools/make-font
# Our data
*.lolfx.cpp

+ 9
- 12
src/Makefile.am Переглянути файл

@@ -36,6 +36,9 @@ liblol_a_SOURCES = \
gpu/indexbuffer.cpp gpu/indexbuffer.h \
gpu/vertexbuffer.cpp gpu/vertexbuffer.h \
gpu/framebuffer.cpp gpu/framebuffer.h \
gpu/defaultmaterial.lolfx \
gpu/emptymaterial.lolfx \
gpu/testmaterial.lolfx \
\
image/image.cpp image/image.h image/image-private.h \
image/codec/gdiplus-image.cpp \
@@ -46,21 +49,15 @@ liblol_a_SOURCES = \
debug/fps.cpp debug/fps.h debug/sphere.cpp debug/sphere.h \
debug/record.cpp debug/record.h debug/stats.cpp debug/stats.h \
debug/quad.cpp debug/quad.h
nodist_liblol_a_SOURCES = \
gpu/defaultmaterial.lolfx.cpp \
gpu/emptymaterial.lolfx.cpp \
gpu/testmaterial.lolfx.cpp
liblol_a_CPPFLAGS = @LOL_CFLAGS@

CLEANFILES = $(filter %.lolfx.cpp, $(SOURCES))

SUFFIXES = .lolfx
%.lolfx.cpp: %.lolfx
echo "/* This file was autogenerated. DO NOT MODIFY IT. */" > $@.tmp
echo "char const *lolfx_$(notdir $(^:%.lolfx=%)) =" >> $@.tmp
$(SED) 's/"/\\"/g' $^ | $(SED) 's/\([^\r]*\).*/"\1\\n"/' >> $@.tmp
echo ";" >> $@.tmp
mv $@.tmp $@
.lolfx.o:
(echo "char const *"; \
echo "lolfx_$(notdir $(basename $(filter %.lolfx, $^))) ="; \
$(SED) 's/"/\\"/g' $(filter %.lolfx, $^) | \
$(SED) 's/\([^\r]*\).*/"\1\\n"/'; \
echo ";") | $(CXXCOMPILE) -xc++ -c - -o $@

sdl_sources = \
image/codec/sdl-image.cpp \


+ 10
- 14
test/tutorial/Makefile.am Переглянути файл

@@ -8,33 +8,29 @@ all-local: $(noinst_PROGRAMS)

CLEANFILES = $(noinst_PROGRAMS:%$(EXEEXT)=%.self) \
$(noinst_PROGRAMS:%$(EXEEXT)=%.elf) \
$(noinst_PROGRAMS:%$(EXEEXT)=%.exe) \
$(filter %.lolfx.cpp, $(SOURCES))
$(noinst_PROGRAMS:%$(EXEEXT)=%.exe)

SUFFIXES = .lolfx
%.lolfx.cpp: %.lolfx
echo "/* This file was autogenerated. DO NOT MODIFY IT. */" > $@.tmp
echo "char const *lolfx_$(notdir $(^:%.lolfx=%)) =" >> $@.tmp
$(SED) 's/"/\\"/g' $^ | $(SED) 's/\([^\r]*\).*/"\1\\n"/' >> $@.tmp
echo ";" >> $@.tmp
mv $@.tmp $@
.lolfx.o:
(echo "char const *"; \
echo "lolfx_$(notdir $(basename $(filter %.lolfx, $^))) ="; \
$(SED) 's/"/\\"/g' $(filter %.lolfx, $^) | \
$(SED) 's/\([^\r]*\).*/"\1\\n"/'; \
echo ";") | $(CXXCOMPILE) -xc++ -c - -o $@

noinst_PROGRAMS = 01_triangle 02_cube 03_fractal

01_triangle_SOURCES = 01_triangle.cpp
nodist_01_triangle_SOURCES = 01_triangle.lolfx.cpp
01_triangle_SOURCES = 01_triangle.cpp 01_triangle.lolfx
01_triangle_CPPFLAGS = @LOL_CFLAGS@ @PIPI_CFLAGS@
01_triangle_LDFLAGS = $(top_builddir)/src/liblol.a @LOL_LIBS@ @PIPI_LIBS@
01_triangle_DEPENDENCIES = $(top_builddir)/src/liblol.a

02_cube_SOURCES = 02_cube.cpp
nodist_02_cube_SOURCES = 02_cube.lolfx.cpp
02_cube_SOURCES = 02_cube.cpp 02_cube.lolfx
02_cube_CPPFLAGS = @LOL_CFLAGS@ @PIPI_CFLAGS@
02_cube_LDFLAGS = $(top_builddir)/src/liblol.a @LOL_LIBS@ @PIPI_LIBS@
02_cube_DEPENDENCIES = $(top_builddir)/src/liblol.a

03_fractal_SOURCES = 03_fractal.cpp
nodist_03_fractal_SOURCES = 03_fractal.lolfx.cpp
03_fractal_SOURCES = 03_fractal.cpp 03_fractal.lolfx
03_fractal_CPPFLAGS = @LOL_CFLAGS@ @PIPI_CFLAGS@
03_fractal_LDFLAGS = $(top_builddir)/src/liblol.a @LOL_LIBS@ @PIPI_LIBS@
03_fractal_DEPENDENCIES = $(top_builddir)/src/liblol.a


Завантаження…
Відмінити
Зберегти