Improved handling of generated files

Place a pre-built copy of generated source files in src/built/, so that
users building SolveSpace from Git without the tools or setup necessary to
generate these can still complete the process.

Makefile.msvc: Use slashes consistently, and added rules to copy files from
src/built/ if needed

configure.ac: Check for presence of src/built/ at configure time

src/Makefile.am: Handle the generated *.table.h files together with
icon*.h; updated the source-generation rules so that the files are created
in builddir, not srcdir; added rules to copy files from src/built/ if
needed
pull/3/head
Daniel Richard G 2013-11-16 23:58:29 -05:00
parent 174ed76ef9
commit 6c68294249
7 changed files with 22097 additions and 21 deletions

View File

@ -132,10 +132,22 @@ $(OBJDIR)\toolbar.obj: src\icons.h
!IFDEF PERL !IFDEF PERL
src\icons.h: src\icons\*.png src\png2c.pl src\icons.h: src\icons\*.png src\png2c.pl
$(PERL) src/png2c.pl $@ icons-proto.h $(PERL) src\png2c.pl $@ src\icons-proto.h
src\bitmapextra.table.h: src\icons\*.png src\pngchar2c.pl src\bitmapextra.table.h: src\icons\*.png src\pngchar2c.pl
$(PERL) src/pngchar2c.pl >$@.tmp $(PERL) src\pngchar2c.pl >$@.tmp
move /y $@.tmp $@ move /y $@.tmp $@
!ENDIF # PERL !ELSE IF EXIST(src\built)
src\icons.h: src\built\icons.h src\built\icons-proto.h
copy /y src\built\icons.h $@
copy /y src\built\icons-proto.h src
src\bitmapextra.table.h: src\built\bitmapextra.table.h
copy /y src\built\bitmapextra.table.h $@
src\bitmapfont.table.h: src\built\bitmapfont.table.h
copy /y src\built\bitmapfont.table.h $@
!ENDIF

View File

@ -58,6 +58,10 @@ AC_CHECK_SIZEOF([long double])
AC_CHECK_SIZEOF([void *]) AC_CHECK_SIZEOF([void *])
AC_CHECK_SIZEOF([size_t]) AC_CHECK_SIZEOF([size_t])
# Is the pre-built source directory present?
#
AM_CONDITIONAL([HAVE_PREBUILT_SOURCE], [test -d $srcdir/src/built])
## ##
## Windows support ## Windows support
## ##

View File

@ -11,14 +11,16 @@ endif
bin_PROGRAMS = solvespace bin_PROGRAMS = solvespace
icons_src = \ built_src = \
icons.h \ bitmapextra.table.h \
icons-proto.h bitmapfont.table.h \
icons-proto.h \
icons.h
BUILT_SOURCES = $(icons_src) BUILT_SOURCES = $(built_src)
solvespace_SOURCES = \ solvespace_SOURCES = \
$(icons_src) \ $(built_src) \
bsp.cpp \ bsp.cpp \
clipboard.cpp \ clipboard.cpp \
confscreen.cpp \ confscreen.cpp \
@ -36,6 +38,7 @@ solvespace_SOURCES = \
expr.h \ expr.h \
expr.cpp \ expr.cpp \
file.cpp \ file.cpp \
font.table.h \
generate.cpp \ generate.cpp \
glhelper.cpp \ glhelper.cpp \
graphicswin.cpp \ graphicswin.cpp \
@ -93,14 +96,14 @@ solvespace_LDFLAGS = \
-lzlib \ -lzlib \
-luser32 -lgdi32 -lcomctl32 -ladvapi32 -lshell32 \ -luser32 -lgdi32 -lcomctl32 -ladvapi32 -lshell32 \
-lopengl32 -lglu32 -lopengl32 -lglu32
else else ! MINGW
solvespace_LDFLAGS = -link \ solvespace_LDFLAGS = -link \
-libpath:$(top_srcdir)/extlib/libpng libpng.lib \ -libpath:$(top_srcdir)/extlib/libpng libpng.lib \
-libpath:$(top_srcdir)/extlib/zlib zlib.lib \ -libpath:$(top_srcdir)/extlib/zlib zlib.lib \
user32.lib gdi32.lib comctl32.lib advapi32.lib shell32.lib \ user32.lib gdi32.lib comctl32.lib advapi32.lib shell32.lib \
opengl32.lib glu32.lib opengl32.lib glu32.lib
endif # MINGW endif ! MINGW
endif # WIN32 endif WIN32
icons = \ icons = \
icons/angle.png \ icons/angle.png \
@ -146,14 +149,8 @@ icons = \
icons/vert.png \ icons/vert.png \
icons/workplane.png icons/workplane.png
tables = \
bitmapextra.table.h \
bitmapfont.table.h \
font.table.h
EXTRA_DIST = \ EXTRA_DIST = \
$(icons) \ $(icons) \
$(tables) \
png2c.pl \ png2c.pl \
pngchar2c.pl \ pngchar2c.pl \
win32/icon.ico \ win32/icon.ico \
@ -163,16 +160,35 @@ EXTRA_DIST = \
if MAINTAINER_MODE if MAINTAINER_MODE
icons.h: $(icons) $(srcdir)/png2c.pl icons.h: $(icons) $(srcdir)/png2c.pl
$(PERL) $(srcdir)/png2c.pl $@ icons-proto.h $(srcdir) $(PERL) $(srcdir)/png2c.pl icons.h icons-proto.h $(srcdir)
icons-proto.h: icons.h icons-proto.h: icons.h
@exit 0 @exit 0
bitmapextra.table.h: $(icons) $(srcdir)/pngchar2c.pl bitmapextra.table.h: $(icons) $(srcdir)/pngchar2c.pl
$(PERL) $(srcdir)/pngchar2c.pl $(srcdir) >$@.tmp $(PERL) $(srcdir)/pngchar2c.pl $(srcdir) >bitmapextra.table.tmp
mv -f $@.tmp $@ mv -f bitmapextra.table.tmp bitmapextra.table.h
endif # MAINTAINER_MODE endif MAINTAINER_MODE
if HAVE_PREBUILT_SOURCE
if ! MAINTAINER_MODE
icons.h: $(srcdir)/built/icons.h
cp $(srcdir)/built/icons.h icons.h
icons-proto.h: $(srcdir)/built/icons-proto.h
cp $(srcdir)/built/icons-proto.h icons-proto.h
bitmapextra.table.h: $(srcdir)/built/bitmapextra.table.h
cp $(srcdir)/built/bitmapextra.table.h bitmapextra.table.h
endif ! MAINTAINER_MODE
bitmapfont.table.h: $(srcdir)/built/bitmapfont.table.h
cp $(srcdir)/built/bitmapfont.table.h bitmapfont.table.h
endif HAVE_PREBUILT_SOURCE
run-valgrind: solvespace$(EXEEXT) run-valgrind: solvespace$(EXEEXT)
@test -z "$$VALGRIND_OPTS" || echo VALGRIND_OPTS = $$VALGRIND_OPTS @test -z "$$VALGRIND_OPTS" || echo VALGRIND_OPTS = $$VALGRIND_OPTS

40
src/built/icons-proto.h Normal file
View File

@ -0,0 +1,40 @@
/**** This is a generated file - do not edit ****/
extern unsigned char Icon_angle[24*24*3];
extern unsigned char Icon_arc[24*24*3];
extern unsigned char Icon_assemble[24*24*3];
extern unsigned char Icon_bezier[24*24*3];
extern unsigned char Icon_circle[24*24*3];
extern unsigned char Icon_constraint[24*24*3];
extern unsigned char Icon_construction[24*24*3];
extern unsigned char Icon_edges[24*24*3];
extern unsigned char Icon_equal[24*24*3];
extern unsigned char Icon_extrude[24*24*3];
extern unsigned char Icon_faces[24*24*3];
extern unsigned char Icon_hidden_lines[24*24*3];
extern unsigned char Icon_horiz[24*24*3];
extern unsigned char Icon_in3d[24*24*3];
extern unsigned char Icon_length[24*24*3];
extern unsigned char Icon_line[24*24*3];
extern unsigned char Icon_mesh[24*24*3];
extern unsigned char Icon_normal[24*24*3];
extern unsigned char Icon_ontoworkplane[24*24*3];
extern unsigned char Icon_other_supp[24*24*3];
extern unsigned char Icon_parallel[24*24*3];
extern unsigned char Icon_perpendicular[24*24*3];
extern unsigned char Icon_point[24*24*3];
extern unsigned char Icon_pointonx[24*24*3];
extern unsigned char Icon_rectangle[24*24*3];
extern unsigned char Icon_ref[24*24*3];
extern unsigned char Icon_same_orientation[24*24*3];
extern unsigned char Icon_shaded[24*24*3];
extern unsigned char Icon_sketch_in_3d[24*24*3];
extern unsigned char Icon_sketch_in_plane[24*24*3];
extern unsigned char Icon_step_rotate[24*24*3];
extern unsigned char Icon_step_translate[24*24*3];
extern unsigned char Icon_symmetric[24*24*3];
extern unsigned char Icon_tangent_arc[24*24*3];
extern unsigned char Icon_text[24*24*3];
extern unsigned char Icon_trim[24*24*3];
extern unsigned char Icon_vert[24*24*3];
extern unsigned char Icon_workplane[24*24*3];

22004
src/built/icons.h Normal file

File diff suppressed because it is too large Load Diff