Moved most of the source into a src/ subdirectory

The SolveSpace top-level directory was getting a bit cluttered, so
following the example of numerous other free-software projects, we move the
main application source into a subdirectory and adjust the build systems
accordingly.

Also, got rid of the obj/ directory in favor of creating it on the fly in
Makefile.msvc.
This commit is contained in:
Daniel Richard G 2013-11-13 02:20:31 -05:00
parent 5429295492
commit 0a24cf40f0
113 changed files with 227 additions and 209 deletions

View File

@ -2,157 +2,7 @@
ACLOCAL_AMFLAGS = -I ac-aux
AM_CPPFLAGS = $(FLTK_CXXFLAGS)
if WIN32
AM_CPPFLAGS += \
-I$(srcdir)/extlib/libpng \
-I$(srcdir)/extlib/si \
-I$(srcdir)/extlib/zlib
endif
bin_PROGRAMS = solvespace
icons_src = \
icons.h \
icons-proto.h
BUILT_SOURCES = $(icons_src)
solvespace_SOURCES = \
$(icons_src) \
bsp.cpp \
clipboard.cpp \
confscreen.cpp \
constraint.cpp \
constrainteq.cpp \
describescreen.cpp \
draw.cpp \
drawconstraint.cpp \
drawentity.cpp \
dsc.h \
entity.cpp \
export.cpp \
exportstep.cpp \
exportvector.cpp \
expr.h \
expr.cpp \
file.cpp \
generate.cpp \
glhelper.cpp \
graphicswin.cpp \
group.cpp \
groupmesh.cpp \
mesh.cpp \
modify.cpp \
mouse.cpp \
polygon.h \
polygon.cpp \
request.cpp \
sketch.h \
solvespace.h \
solvespace.cpp \
style.cpp \
system.cpp \
textscreens.cpp \
textwin.cpp \
toolbar.cpp \
ttf.cpp \
ui.h \
undoredo.cpp \
util.cpp \
view.cpp \
srf/boolean.cpp \
srf/curve.cpp \
srf/merge.cpp \
srf/ratpoly.cpp \
srf/raycast.cpp \
srf/surface.h \
srf/surface.cpp \
srf/surfinter.cpp \
srf/triangulate.cpp
if HAVE_FLTK
solvespace_SOURCES += \
fltk/xFl_Gl_Window_Group.H \
fltk/xFl_Gl_Window_Group.cxx \
fltk/fltkmain.cpp \
fltk/fltkutil.cpp
solvespace_LDADD = $(FLTK_LDSTATICFLAGS) -lGLU
endif
if WIN32
solvespace_SOURCES += \
win32/freeze.h \
win32/freeze.cpp \
win32/w32main.cpp \
win32/w32util.cpp
if MINGW
solvespace_LDFLAGS = \
-llibpng \
-lzlib \
-luser32 -lgdi32 -lcomctl32 -ladvapi32 -lshell32 \
-lopengl32 -lglu32
else
solvespace_LDFLAGS = -link \
-libpath:$(srcdir)/extlib/libpng libpng.lib \
-libpath:$(srcdir)/extlib/zlib zlib.lib \
user32.lib gdi32.lib comctl32.lib advapi32.lib shell32.lib \
opengl32.lib glu32.lib
endif # MINGW
endif # WIN32
icons = \
icon.ico \
icons/angle.png \
icons/arc.png \
icons/assemble.png \
icons/bezier.png \
icons/char-0-check-false.png \
icons/char-1-check-true.png \
icons/char-2-radio-false.png \
icons/char-3-radio-true.png \
icons/circle.png \
icons/constraint.png \
icons/construction.png \
icons/edges.png \
icons/equal.png \
icons/extrude.png \
icons/faces.png \
icons/hidden-lines.png \
icons/horiz.png \
icons/in3d.png \
icons/length.png \
icons/line.png \
icons/mesh.png \
icons/normal.png \
icons/ontoworkplane.png \
icons/other-supp.png \
icons/parallel.png \
icons/perpendicular.png \
icons/point.png \
icons/pointonx.png \
icons/rectangle.png \
icons/ref.png \
icons/same-orientation.png \
icons/shaded.png \
icons/sketch-in-3d.png \
icons/sketch-in-plane.png \
icons/step-rotate.png \
icons/step-translate.png \
icons/symmetric.png \
icons/tangent-arc.png \
icons/text.png \
icons/trim.png \
icons/vert.png \
icons/workplane.png
tables = \
bitmapextra.table.h \
bitmapfont.table.h \
font.table.h
SUBDIRS = src
exposed = \
exposed/CDemo.c \
@ -163,19 +13,13 @@ exposed = \
exposed/slvs.h
EXTRA_DIST = \
$(icons) \
$(tables) \
$(exposed) \
COPYING.txt \
Makefile.msvc \
extlib/build-fltk.sh \
png2c.pl \
pngchar2c.pl \
tools/Makefile \
tools/ttf2c.cpp \
wishlist.txt \
win32/manifest.xml \
win32/resource.rc
wishlist.txt
optional_dist = \
extlib/libpng/png.h \
@ -211,36 +55,4 @@ dist-hook:
exit 1; \
fi
if MAINTAINER_MODE
icons.h: $(icons) $(srcdir)/png2c.pl
$(PERL) $(srcdir)/png2c.pl $@ icons-proto.h $(srcdir)
icons-proto.h: icons.h
@exit 0
bitmapextra.table.h: $(icons) $(srcdir)/pngchar2c.pl
$(PERL) $(srcdir)/pngchar2c.pl $(srcdir) >$@.tmp
mv -f $@.tmp $@
endif # MAINTAINER_MODE
run-valgrind: solvespace$(EXEEXT)
@test -z "$$VALGRIND_OPTS" || echo VALGRIND_OPTS = $$VALGRIND_OPTS
valgrind \
--tool=memcheck \
--verbose \
--track-fds=yes \
--log-file=vg.%p.out \
--num-callers=50 \
--error-limit=no \
--read-var-info=yes \
--leak-check=full \
--leak-resolution=high \
--show-reachable=yes \
--track-origins=yes \
--malloc-fill=0xac \
--free-fill=0xde \
./solvespace$(EXEEXT)
## end Makefile.am

View File

@ -20,11 +20,18 @@ DEFINES = \
# We build with /MT for compatibility with the SpaceWare library, and to
# avoid a needless dependency on a C runtime DLL.
#
CXXFLAGS = /nologo /W3 /MT /I. /Iextlib\libpng /Iextlib\si /Iextlib\zlib /Zi /EHs # /O2
CXXFLAGS = /nologo /W3 /MT /Isrc /Iextlib\libpng /Iextlib\si /Iextlib\zlib /Zi /EHs # /O2
HEADERS = win32\freeze.h ui.h solvespace.h dsc.h sketch.h expr.h polygon.h srf\surface.h
HEADERS = src\dsc.h \
src\expr.h \
src\polygon.h \
src\sketch.h \
src\solvespace.h \
src\srf\surface.h \
src\ui.h \
src\win32\freeze.h
OBJDIR = obj
OBJDIR = obj
W32OBJS = $(OBJDIR)\freeze.obj \
$(OBJDIR)\w32main.obj \
@ -94,37 +101,41 @@ all: $(OBJDIR)\solvespace.exe
@echo solvespace.exe
clean:
del /q obj\*
-rmdir /s /q $(OBJDIR)
$(OBJDIR)\solvespace.exe: $(SSOBJS) $(SRFOBJS) $(W32OBJS) $(RES)
$(CXX) $(DEFINES) $(CXXFLAGS) /Fe$(OBJDIR)\solvespace.exe $(SSOBJS) $(SRFOBJS) $(W32OBJS) $(RES) $(LIBS)
editbin /nologo /STACK:8388608 $(OBJDIR)\solvespace.exe
{.}.cpp{$(OBJDIR)}.obj::
{src}.cpp{$(OBJDIR)}.obj::
@if not exist $(OBJDIR) mkdir $(OBJDIR)
$(CXX) $(CXXFLAGS) $(DEFINES) /c /Fo$(OBJDIR)\ $<
{srf}.cpp{$(OBJDIR)}.obj::
{src\srf}.cpp{$(OBJDIR)}.obj::
@if not exist $(OBJDIR) mkdir $(OBJDIR)
$(CXX) $(CXXFLAGS) $(DEFINES) /c /Fo$(OBJDIR)\ $<
{win32}.cpp{$(OBJDIR)}.obj::
{src\win32}.cpp{$(OBJDIR)}.obj::
@if not exist $(OBJDIR) mkdir $(OBJDIR)
$(CXX) $(CXXFLAGS) $(DEFINES) /c /Fo$(OBJDIR)\ $<
$(RES): win32\$(@B).rc icon.ico
$(RC) /fo$@ win32\$(@B).rc
$(RES): src\win32\$(@B).rc src\win32\icon.ico
@if not exist $(OBJDIR) mkdir $(OBJDIR)
$(RC) /fo$@ src\win32\$(@B).rc
$(OBJDIR)\glhelper.obj: bitmapextra.table.h bitmapfont.table.h font.table.h
$(OBJDIR)\glhelper.obj: src\bitmapextra.table.h src\bitmapfont.table.h src\font.table.h
$(OBJDIR)\textwin.obj: icons.h
$(OBJDIR)\textwin.obj: src\icons.h
$(OBJDIR)\toolbar.obj: icons.h
$(OBJDIR)\toolbar.obj: src\icons.h
!IFDEF PERL
icons.h: icons\*.png png2c.pl
$(PERL) png2c.pl $@ icons-proto.h
src\icons.h: src\icons\*.png src\png2c.pl
$(PERL) src/png2c.pl $@ icons-proto.h
bitmapextra.table.h: icons\*.png pngchar2c.pl
$(PERL) pngchar2c.pl >tmp.$@
move /y tmp.$@ $@
src\bitmapextra.table.h: src\icons\*.png src\pngchar2c.pl
$(PERL) src/pngchar2c.pl >$@.tmp
move /y $@.tmp $@
!ENDIF # PERL

View File

@ -3,7 +3,7 @@
AC_PREREQ([2.59])
AC_INIT([SolveSpace], [2.1], [jwesthues@cq.cx], [solvespace])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_SRCDIR([solvespace.cpp])
AC_CONFIG_SRCDIR([src/solvespace.cpp])
AC_CONFIG_AUX_DIR([ac-aux])
AC_CONFIG_MACRO_DIR([ac-aux])
@ -115,7 +115,7 @@ fi
## Wrap it up
##
AC_CONFIG_FILES([Makefile])
AC_CONFIG_FILES([Makefile src/Makefile])
AC_OUTPUT
cat <<EOF

0
obj/t
View File

195
src/Makefile.am Normal file
View File

@ -0,0 +1,195 @@
## src/Makefile.am
AM_CPPFLAGS = $(FLTK_CXXFLAGS)
if WIN32
AM_CPPFLAGS += \
-I$(top_srcdir)/extlib/libpng \
-I$(top_srcdir)/extlib/si \
-I$(top_srcdir)/extlib/zlib
endif
bin_PROGRAMS = solvespace
icons_src = \
icons.h \
icons-proto.h
BUILT_SOURCES = $(icons_src)
solvespace_SOURCES = \
$(icons_src) \
bsp.cpp \
clipboard.cpp \
confscreen.cpp \
constraint.cpp \
constrainteq.cpp \
describescreen.cpp \
draw.cpp \
drawconstraint.cpp \
drawentity.cpp \
dsc.h \
entity.cpp \
export.cpp \
exportstep.cpp \
exportvector.cpp \
expr.h \
expr.cpp \
file.cpp \
generate.cpp \
glhelper.cpp \
graphicswin.cpp \
group.cpp \
groupmesh.cpp \
mesh.cpp \
modify.cpp \
mouse.cpp \
polygon.h \
polygon.cpp \
request.cpp \
sketch.h \
solvespace.h \
solvespace.cpp \
style.cpp \
system.cpp \
textscreens.cpp \
textwin.cpp \
toolbar.cpp \
ttf.cpp \
ui.h \
undoredo.cpp \
util.cpp \
view.cpp \
srf/boolean.cpp \
srf/curve.cpp \
srf/merge.cpp \
srf/ratpoly.cpp \
srf/raycast.cpp \
srf/surface.h \
srf/surface.cpp \
srf/surfinter.cpp \
srf/triangulate.cpp
if HAVE_FLTK
solvespace_SOURCES += \
fltk/xFl_Gl_Window_Group.H \
fltk/xFl_Gl_Window_Group.cxx \
fltk/fltkmain.cpp \
fltk/fltkutil.cpp
solvespace_LDADD = $(FLTK_LDSTATICFLAGS) -lGLU
endif
if WIN32
solvespace_SOURCES += \
win32/freeze.h \
win32/freeze.cpp \
win32/w32main.cpp \
win32/w32util.cpp
if MINGW
solvespace_LDFLAGS = \
-llibpng \
-lzlib \
-luser32 -lgdi32 -lcomctl32 -ladvapi32 -lshell32 \
-lopengl32 -lglu32
else
solvespace_LDFLAGS = -link \
-libpath:$(top_srcdir)/extlib/libpng libpng.lib \
-libpath:$(top_srcdir)/extlib/zlib zlib.lib \
user32.lib gdi32.lib comctl32.lib advapi32.lib shell32.lib \
opengl32.lib glu32.lib
endif # MINGW
endif # WIN32
icons = \
icons/angle.png \
icons/arc.png \
icons/assemble.png \
icons/bezier.png \
icons/char-0-check-false.png \
icons/char-1-check-true.png \
icons/char-2-radio-false.png \
icons/char-3-radio-true.png \
icons/circle.png \
icons/constraint.png \
icons/construction.png \
icons/edges.png \
icons/equal.png \
icons/extrude.png \
icons/faces.png \
icons/hidden-lines.png \
icons/horiz.png \
icons/in3d.png \
icons/length.png \
icons/line.png \
icons/mesh.png \
icons/normal.png \
icons/ontoworkplane.png \
icons/other-supp.png \
icons/parallel.png \
icons/perpendicular.png \
icons/point.png \
icons/pointonx.png \
icons/rectangle.png \
icons/ref.png \
icons/same-orientation.png \
icons/shaded.png \
icons/sketch-in-3d.png \
icons/sketch-in-plane.png \
icons/step-rotate.png \
icons/step-translate.png \
icons/symmetric.png \
icons/tangent-arc.png \
icons/text.png \
icons/trim.png \
icons/vert.png \
icons/workplane.png
tables = \
bitmapextra.table.h \
bitmapfont.table.h \
font.table.h
EXTRA_DIST = \
$(icons) \
$(tables) \
png2c.pl \
pngchar2c.pl \
win32/icon.ico \
win32/manifest.xml \
win32/resource.rc
if MAINTAINER_MODE
icons.h: $(icons) $(srcdir)/png2c.pl
$(PERL) $(srcdir)/png2c.pl $@ icons-proto.h $(srcdir)
icons-proto.h: icons.h
@exit 0
bitmapextra.table.h: $(icons) $(srcdir)/pngchar2c.pl
$(PERL) $(srcdir)/pngchar2c.pl $(srcdir) >$@.tmp
mv -f $@.tmp $@
endif # MAINTAINER_MODE
run-valgrind: solvespace$(EXEEXT)
@test -z "$$VALGRIND_OPTS" || echo VALGRIND_OPTS = $$VALGRIND_OPTS
valgrind \
--tool=memcheck \
--verbose \
--track-fds=yes \
--log-file=vg.%p.out \
--num-callers=50 \
--error-limit=no \
--read-var-info=yes \
--leak-check=full \
--leak-resolution=high \
--show-reachable=yes \
--track-origins=yes \
--malloc-fill=0xac \
--free-fill=0xde \
./solvespace$(EXEEXT)
## end src/Makefile.am

View File

View File

View File

Before

Width:  |  Height:  |  Size: 27 KiB

After

Width:  |  Height:  |  Size: 27 KiB

View File

Before

Width:  |  Height:  |  Size: 27 KiB

After

Width:  |  Height:  |  Size: 27 KiB

View File

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 26 KiB

View File

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 26 KiB

View File

Before

Width:  |  Height:  |  Size: 218 B

After

Width:  |  Height:  |  Size: 218 B

View File

Before

Width:  |  Height:  |  Size: 243 B

After

Width:  |  Height:  |  Size: 243 B

View File

Before

Width:  |  Height:  |  Size: 228 B

After

Width:  |  Height:  |  Size: 228 B

View File

Before

Width:  |  Height:  |  Size: 231 B

After

Width:  |  Height:  |  Size: 231 B

View File

Before

Width:  |  Height:  |  Size: 27 KiB

After

Width:  |  Height:  |  Size: 27 KiB

View File

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 26 KiB

View File

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 26 KiB

View File

Before

Width:  |  Height:  |  Size: 27 KiB

After

Width:  |  Height:  |  Size: 27 KiB

View File

Before

Width:  |  Height:  |  Size: 27 KiB

After

Width:  |  Height:  |  Size: 27 KiB

View File

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 26 KiB

View File

Before

Width:  |  Height:  |  Size: 609 B

After

Width:  |  Height:  |  Size: 609 B

View File

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 26 KiB

View File

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 26 KiB

View File

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 26 KiB

View File

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 26 KiB

View File

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 26 KiB

View File

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 28 KiB

View File

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 26 KiB

View File

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 25 KiB

View File

Before

Width:  |  Height:  |  Size: 27 KiB

After

Width:  |  Height:  |  Size: 27 KiB

View File

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 26 KiB

View File

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 26 KiB

View File

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 25 KiB

View File

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 26 KiB

View File

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 26 KiB

View File

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 25 KiB

View File

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 26 KiB

View File

Before

Width:  |  Height:  |  Size: 317 B

After

Width:  |  Height:  |  Size: 317 B

View File

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 26 KiB

View File

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 26 KiB

View File

Before

Width:  |  Height:  |  Size: 27 KiB

After

Width:  |  Height:  |  Size: 27 KiB

View File

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 26 KiB

View File

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 26 KiB

View File

Before

Width:  |  Height:  |  Size: 27 KiB

After

Width:  |  Height:  |  Size: 27 KiB

View File

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 26 KiB

View File

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 26 KiB

View File

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 26 KiB

View File

Before

Width:  |  Height:  |  Size: 395 B

After

Width:  |  Height:  |  Size: 395 B

Some files were not shown because too many files have changed in this diff Show More