SubInclude TOP src ;
SubInclude TOP data ;
+UseAutoconf ;
+
+# for now...
+Package [ Wildcard po : *.po *.in Changelog ] ;
+Package [ Wildcard intl : *.c *.h ChangeLog VERSION Makefile.in ] ;
+Package INSTALL NEWS README COPYING AUTHORS ChangeLog ABOUT-NLS depcomp
+ install-sh mkinstalldirs missing ;
+
+Package Makefile.am src/Makefile.am lib/Makefile.am data/Makefile.am
+ po/Makefile.in.in intl/Makefile.in ;
-SUBDIRS = intl m4 lib src data po
+SUBDIRS = intl lib src data po
EXTRA_DIST = LEVELDESIGN TODO contrib/levelconverter-0.0.6_0.0.7.py autogen.sh
-ACLOCAL_AMFLAGS = -I m4
+ACLOCAL_AMFLAGS = -I mk/autoconf
AUTOMAKE_OPTIONS = 1.6 dist-bzip2
exit 1
fi
+autoheader
+libtoolize --force
+aclocal -I mk/autoconf
+
# generate Jamconfig.in
autoconf --trace=AC_SUBST \
| sed -e 's/configure.ac:[0-9]*:AC_SUBST:\([^:]*\).*/\1 ?= "@\1@" ;/g' \
# see AUTOMAKE_OPTIONS in Makefile.am
export WANT_AUTOMAKE=1.6
-autoheader
-libtoolize --force
-aclocal -I mk/autoconf
automake --copy --add-missing
autoconf
AC_INIT_JAM
AC_CONFIG_FILES([Jamconfig])
-AC_OUTPUT(Makefile m4/Makefile intl/Makefile
+AC_OUTPUT(Makefile intl/Makefile
src/Makefile
data/Makefile
po/Makefile.in
images/intro
images/leveleditor
images/map
+ images/shared
images/shared/smalltux
images/shared/bigtux
images/status
## all target.
rule Application
{
- # check options
- CheckOptions noinstall console independent : $(3) : $(<) ;
+ # check options
+ CheckOptions noinstall console independent : $(3) : $(<) ;
- local target = [ ConstructApplicationTarget $(<) : $(3) ] ;
- local sources = [ DoSourceGrist $(>) ] ;
- local objects = [ CompileObjects $(sources) ] ;
+ local target = [ ConstructApplicationTarget $(<) : $(3) ] ;
+ local sources = [ DoSourceGrist $(>) ] ;
+ local objects = [ CompileObjects $(sources) ] ;
- $(<)_TYPE = application ;
- $(<)_OBJECTS = $(objects) ;
- $(<)_SOURCES = $(sources) ;
- $(<)_TARGET = $(target) ;
- $(<)_OPTIONS = $(3) ;
- $(<)_INSTALLTARGET = ;
+ $(<)_TYPE = application ;
+ $(<)_OBJECTS = $(objects) ;
+ $(<)_SOURCES = $(sources) ;
+ $(<)_TARGET = $(target) ;
+ $(<)_OPTIONS = $(3) ;
+ $(<)_INSTALLTARGET = ;
- # create target clean rule
- Always $(<)clean ;
- NotFile $(<)clean ;
- Clean $(<)clean : $(objects) ; # create target clean rule
- Depends clean : $(<)clean ;
+ # create target clean rule
+ Always $(<)clean ;
+ NotFile $(<)clean ;
+ Clean $(<)clean : $(objects) ; # create target clean rule
+ Depends clean : $(<)clean ;
- # so 'jam foo' works when it's really foo.exe (Windows) or foo.app (MacOS/X)
- if $(target) != $(<)
- {
- Depends $(<) : $(target) ;
- NotFile $(<) ;
- }
+ # so 'jam foo' works when it's really foo.exe (Windows) or foo.app (MacOS/X)
+ if $(target) != $(<)
+ {
+ Depends $(<) : $(target) ;
+ NotFile $(<) ;
+ }
- # make dependency on apps target
- if ! [ IsElem independent : $(3) ]
- {
- Depends apps : $(<) ;
- }
+ # make dependency on apps target
+ if ! [ IsElem independent : $(3) ]
+ {
+ Depends apps : $(<) ;
+ }
- # construct Install target
- if ! [ IsElem noinstall : $(3) ]
- {
- $(<)_INSTALLTARGET = [ DoInstall $(target) : $(bindir) : $(INSTALL_PROGRAM) ] ;
- Depends install_bin : $($(<)_INSTALLTARGET) ;
- }
+ # construct Install target
+ if ! [ IsElem noinstall : $(3) ]
+ {
+ $(<)_INSTALLTARGET = [
+ DoInstall $(target) : $(bindir) : $(INSTALL_PROGRAM) : nopackage
+ ] ;
+ Depends install_bin : $($(<)_INSTALLTARGET) ;
+ }
- # Link
- MakeLocate $(target) : $(LOCATE_TARGETS) ;
- SystemLinkApplication $(<) : $(objects) : $(3) ;
+ # Link
+ MakeLocate $(target) : $(LOCATE_TARGETS) ;
+ SystemLinkApplication $(<) : $(objects) : $(3) ;
- # Import default flags
- CppFlags $(<) : $(CPPFLAGS) $(APPLICTION_CPPFLAGS) ;
- CFlags $(<) : $(CFLAGS) $(APPLICATION_CFLAGS) ;
- C++Flags $(<) : $(C++FLAGS) $(APPLICATION_C++FLAGS) ;
- LFlags $(<) : $(LFLAGS) $(APPLICATION_LFLAGS) ;
+ # Import default flags
+ CppFlags $(<) : $(CPPFLAGS) $(APPLICTION_CPPFLAGS) ;
+ CFlags $(<) : $(CFLAGS) $(APPLICATION_CFLAGS) ;
+ C++Flags $(<) : $(C++FLAGS) $(APPLICATION_C++FLAGS) ;
+ LFlags $(<) : $(LFLAGS) $(APPLICATION_LFLAGS) ;
+
+ # Sources are part of the package
+ if ! [ IsElem nopackage : $(3) ]
+ {
+ Package $(sources) ;
+ }
}
#----------------------------------------------------------------------------
# Clean rules for autoconf generated stuff
-# construct some clean targets
-Clean distclean : config.log config.status config.cache aclocal.m4
- Jamconfig config.h out.txt log.txt stamp-h1
- libtool ;
-CleanDir distclean : autom4te.cache out ;
-Depends distclean : clean ;
+## Setup some stuff that makes usage of autoconf easier
+rule UseAutoconf
+{
+ # construct some clean targets
+ Clean distclean : config.log config.status config.cache aclocal.m4
+ Jamconfig config.h out.txt log.txt stamp-h1
+ libtool ;
+ CleanDir distclean : autom4te.cache out ;
+ Depends distclean : clean ;
-Clean cvsclean : configure aclocal.m4 config.h.in Jamconfig.in ;
-Depends cvsclean : distclean ;
+ Clean cvsclean : configure aclocal.m4 config.h.in Jamconfig.in ;
+ Depends cvsclean : distclean ;
-Help clean : "Cleanup objectfiles and targets" ;
-Help distclean : "Cleanup objectfiles and build configuration" ;
-Help cvsclean : "Cleanup all objectfiles, buildconfig and generated files." ;
+ Help clean : "Cleanup objectfiles and targets" ;
+ Help distclean : "Cleanup objectfiles and build configuration" ;
+ Help cvsclean :
+ "Cleanup all objectfiles, buildconfig and generated files." ;
+ Package autogen.sh configure.ac configure config.h.in
+ Jamrules Jamconfig.in ;
+ Package [ Wildcard mk/jam : *.jam ] [ Wildcard mk/autoconf : *.m4 ]
+ mk/autoconf/config.guess mk/autoconf/config.sub
+ mk/autoconf/install-sh ;
+}
include $(jamrulesdir)/helper.jam ;
include $(jamrulesdir)/subdir.jam ;
+include $(jamrulesdir)/package.jam ;
+
include $(jamrulesdir)/variant.jam ;
include $(jamrulesdir)/resource.jam ;
## Copy source file to target.
actions Copy
{
- $(CP) $(>) $(<)
+ $(CP) "$(>)" "$(<)"
}
actions ignore Move
}
}
-## DoInstall sourcename : directories [ : installapp ]
+## DoInstall sourcename : directories [ : installapp ] [ : options ]
## Creates a new installtarget for the given sources. The target(s) are
## returned as function result.
rule DoInstall
gdir = $(dir:G=dir) ;
MkDir $(gdir) ;
- for i in $(1) {
+ for i in $(<) {
target = $(i:BSR=$(dir):G=install) ;
targets += $(target) ;
Depends $(target) : $(gdir) $(i) ;
}
}
+ # We want to package all files we install
+ if ! [ IsElem nopackage : $(4) ] {
+ Package $(<) ;
+ }
+
Always $(targets) ;
return $(targets) ;
}
# Generate install rules
if ! [ IsElem noinstall : $(3) ]
{
- install_targets = [ DoInstall $(target) : $(libdir) ] ;
+ install_targets = [ DoInstall $(target) : $(libdir) : $(INSTALL) : nopackage ] ;
Depends install_lib : $(install_targets) ;
}
CFlags $(<) : $(CFLAGS) $(LIBRARY_CFLAGS) ;
C++Flags $(<) : $(C++FLAGS) $(LIBRARY_C++FLAGS) ;
LFlags $(<) : $(LFLAGS) $(LIBRARY_LFLAGS) ;
+
+ # Sources are part of the package
+ if ! [ IsElem nopackage : $(3) ]
+ {
+ Package $(sources) ;
+ }
}
## LibraryVersion
--- /dev/null
+#============================================================================
+# Rules for creating distribution packages
+#============================================================================
+
+PACKAGE_FILES = ;
+PACKAGE_FILE = $(PACKAGE_NAME)-$(PACKAGE_VERSION).tar.bz2 ;
+PACKAGE_DIR = $(PACKAGE_NAME)-$(PACKAGE_VERSION) ;
+LOCATE_DISTTEMP ?= $(top_builddir)/build/dist ;
+
+## Package files
+## Add files to distribution package
+rule Package
+{
+ for i in $(<) {
+ local target = $(i:R=$(LOCATE_DISTTEMP)/$(PACKAGE_DIR)/$(SUBDIR)) ;
+ local dir = $(i:DR=$(LOCATE_DISTTEMP)/$(PACKAGE_DIR)/$(SUBDIR)) ;
+ local source = $(i:G=$(SOURCE_GRIST:E)_PACKAGE) ;
+ MkDir $(dir) ;
+ Copy $(target) : $(source) ;
+ LOCATE on $(source) = $(SUBDIR) ;
+ Depends $(target) : $(dir) ;
+ Depends $(target) : $(source) ;
+ Depends $(PACKAGE_FILE) : $(target) ;
+ }
+}
+
+actions TarBz2
+{
+ tar -c --bzip2 -C $(LOCATE_DISTTEMP) -f $(<) $(PACKAGE_DIR)
+}
+
+TarBz2 $(PACKAGE_FILE) ;
+Depends dist : $(PACKAGE_FILE) ;
# (until jampeople accept my patches :-/ )
#============================================================================
-LOCATE_OBJECTS ?= $(top_builddir)/out/$(target) ;
+LOCATE_OBJECTS ?= $(top_builddir)/build/$(target) ;
LOCATE_TARGETS ?= $(top_builddir) ;
-LOCATE_DOCS ?= $(top_builddir)/out ;
+LOCATE_DOCS ?= $(top_builddir)/build ;
SUBDIRRULES += FixSubDirPath ;
{
LOCATE_SOURCE = [ ConcatDirs $(LOCATE_OBJECTS) $(SUBDIR_TOKENS) ] ;
LOCATE_TARGET = [ ConcatDirs $(LOCATE_OBJECTS) $(SUBDIR_TOKENS) ] ;
+
+ # We need to package the Jamfile (a bit hacky here...)
+ Package Jamfile ;
}
# fix bug in Jambase where SubInclude in the middle of a jam file made it break