[Super-tux-commit] supertux/mk/jam package.jam,NONE,1.1 application.jam,1.1,1.2 autoconf.jam,1.1,1.2
Brought to you by:
wkendrick
From: Matze B. <mat...@us...> - 2004-11-23 19:36:49
|
Update of /cvsroot/super-tux/supertux/mk/jam In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4130/mk/jam Modified Files: application.jam autoconf.jam build.jam helper.jam install.jam library.jam subdir.jam Added Files: package.jam Log Message: add a dist target to jam Index: subdir.jam =================================================================== RCS file: /cvsroot/super-tux/supertux/mk/jam/subdir.jam,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- subdir.jam 23 Nov 2004 16:47:25 -0000 1.1 +++ subdir.jam 23 Nov 2004 19:36:28 -0000 1.2 @@ -3,9 +3,9 @@ # (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 ; @@ -16,6 +16,9 @@ { 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 --- NEW FILE: package.jam --- #============================================================================ # 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) ; Index: build.jam =================================================================== RCS file: /cvsroot/super-tux/supertux/mk/jam/build.jam,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- build.jam 23 Nov 2004 16:47:25 -0000 1.1 +++ build.jam 23 Nov 2004 19:36:28 -0000 1.2 @@ -11,6 +11,8 @@ include $(jamrulesdir)/helper.jam ; include $(jamrulesdir)/subdir.jam ; +include $(jamrulesdir)/package.jam ; + include $(jamrulesdir)/variant.jam ; include $(jamrulesdir)/resource.jam ; Index: helper.jam =================================================================== RCS file: /cvsroot/super-tux/supertux/mk/jam/helper.jam,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- helper.jam 23 Nov 2004 16:47:25 -0000 1.1 +++ helper.jam 23 Nov 2004 19:36:28 -0000 1.2 @@ -167,7 +167,7 @@ ## Copy source file to target. actions Copy { - $(CP) $(>) $(<) + $(CP) "$(>)" "$(<)" } actions ignore Move Index: library.jam =================================================================== RCS file: /cvsroot/super-tux/supertux/mk/jam/library.jam,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- library.jam 23 Nov 2004 16:47:25 -0000 1.1 +++ library.jam 23 Nov 2004 19:36:28 -0000 1.2 @@ -59,7 +59,7 @@ # Generate install rules if ! [ IsElem noinstall : $(3) ] { - install_targets = [ DoInstall $(target) : $(libdir) ] ; + install_targets = [ DoInstall $(target) : $(libdir) : $(INSTALL) : nopackage ] ; Depends install_lib : $(install_targets) ; } @@ -117,6 +117,12 @@ 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 Index: autoconf.jam =================================================================== RCS file: /cvsroot/super-tux/supertux/mk/jam/autoconf.jam,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- autoconf.jam 23 Nov 2004 16:47:25 -0000 1.1 +++ autoconf.jam 23 Nov 2004 19:36:28 -0000 1.2 @@ -1,15 +1,25 @@ # 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 ; +} Index: install.jam =================================================================== RCS file: /cvsroot/super-tux/supertux/mk/jam/install.jam,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- install.jam 23 Nov 2004 16:47:25 -0000 1.1 +++ install.jam 23 Nov 2004 19:36:28 -0000 1.2 @@ -85,7 +85,7 @@ } } -## 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 @@ -96,7 +96,7 @@ 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) ; @@ -109,6 +109,11 @@ } } + # We want to package all files we install + if ! [ IsElem nopackage : $(4) ] { + Package $(<) ; + } + Always $(targets) ; return $(targets) ; } Index: application.jam =================================================================== RCS file: /cvsroot/super-tux/supertux/mk/jam/application.jam,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- application.jam 23 Nov 2004 16:47:25 -0000 1.1 +++ application.jam 23 Nov 2004 19:36:28 -0000 1.2 @@ -24,55 +24,63 @@ ## 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) ; + } } #---------------------------------------------------------------------------- |