token type renamed to token_t
[k8jam.git] / Jamrules
blobb32bc7c8df1c1c3ddc93ca0adc4f7e94c36268fa
1 if ! $(THIS_IS_K8JAM) { Exit "I WANT K8JAM!" ; }
2 # Jamfile to build Jam (a make(1)-like program)
3 # There are no user-serviceable parts in this file.
4 VERSION = k8jam-2.6.1 ;
7 # rule --bind-rule-- target : path {
8 #   Echo "--bind-rule-- target:" $(target) : -n ;
9 #   Echo "-- path:" $(path) ;
10 # }
11 # BINDRULE = --bind-rule-- ;
14 if ! $(DEBUG) {
15   if ! $(DONT_COMPACT) { DEFINES += MKJAMBASE_COMPACT ; }
17 #DEFINES += OPT_HEADER_CACHE_EXT ;
18 if $(DIET) { DEFINES += USE_DIETLIBC ; }
21 set-profile ;
22 set-target-locations ;
23 gcc-suggest-attrs ;
26 #if ! $(PREFIX) { PREFIX = /usr/local ; }
28 include $(TOP)/Jamrules.configure ;
31 # note that we use the target directory 'bin.unix' to ensure that
32 # 'make install' and 'make uninstall' work correctly
33 if $(UNIX) {
34   #if ! $(LOCATE_TARGET) { LOCATE_TARGET = bin.unix/obj ; }
35   ALL_LOCATE_BIN = $(TOP)/bin.unix ;
36 } else {
37   #if ! $(LOCATE_TARGET) { LOCATE_TARGET = bin.$(OSFULL[1]:L)$(PATH_SEPARATOR)obj ; }
38   ALL_LOCATE_BIN = $(TOP)$(PATH_SEPARATOR)bin.$(OSFULL[1]:L) ;
41 # Leave generated source in current directory; it would be nice to use
42 # these lines below to build the source into the platform-specific
43 # directory, but getting scan.c to include the right jambase.h is
44 # hard: with ""'s, it always gets the bootstrap version; with <>'s,
45 # it won't find the bootstrap version.
47 # SEARCH_SOURCE ?= $(LOCATE_TARGET) $(DOT) ;
48 # LOCATE_SOURCE ?= $(LOCATE_TARGET) ;
50 # For some really stupid reason, classic Jam doesn't define NT
51 # when compiling with Mingw, but the variable MINGW instead..
53 if ! $(NT) && $(MINGW) {
54   NT = 1 ;
55   JAM_TOOLSET = MINGW ;
58 if $(UNIX) && $(OS) = CYGWIN {
59   CCFLAGS += -D__cygwin__ ;
63 # We have to signal jam.h for these
64 if $(OS) = NT {
65   switch $(JAM_TOOLSET) {
66     case MINGW       : CCFLAGS += -DNT ;
67     case LCC         : CCFLAGS += -DNT ;
68     case DIGITALMARS : CCFLAGS += -DNT ;
69     case *           : CCFLAGS += /DNT ;
70   }
74 if ! $(DEBUG) && ! $(VALGRIND) {
75   if $(UNIX) {
76     actions Strip {
77       strip -s $(1)
78     }
79   }
80   # Strip the Jam executable on Mingw
81   if $(JAM_TOOLSET) = MINGW {
82     actions Strip {
83       strip $(1)
84     }
85   }
89 # installing
90 #if $(UNIX) {
91   #if $(DESTDIR) { INSTALLDIR_PREFIX = $(DESTDIR)$(PREFIX) ; } else { INSTALLDIR_PREFIX = $(PREFIX) ; }
92   #INSTALLDIR_BIN = $(INSTALLDIR_PREFIX)/bin ;
93   #INSTALLDIR_MAN = $(INSTALLDIR_PREFIX)/man ;
94   #INSTALLDIR_DOCS = $(INSTALLDIR_PREFIX)/share/doc/$(VERSION) ;
98 # this was needed 'cause (LOCATE_SOURCE) was targeted there
99 #HDRS += $(ALL_LOCATE_TARGET)/src ;
102 actions quietly AShowHelp {
103   echo "usage: jam [target] [flags]"
104   echo "targets:"
105   echo "  all/<empty>  -- build"
106   #echo "  push         -- push to external git repository"
109 #InstallBin bin : jam ;
111 softinclude $(TOP)/Jamrules.local ;
112 softinclude $(TOP)/Jamrules.push ;
113 softinclude $(TOP)/Jamrules.install ;
116 rule Lemon {
117   local _h ;
119   _h = $(<:BS=.h) ;
121   #Echo "Lemon: <:" $(<) ;
122   #Echo "Lemon: >:" $(>) ;
123   #Exit "fuck!" ;
125   # Some places don't have a yacc.
126   MakeLocate $(<) $(_h) : $(LOCATE_SOURCE) ;
127   #MakeLocate $(>) $(_h) : $(LOCATE_SOURCE) ;
129   Depends $(<) $(_h) : $(>) ;
130   GenFile $(<) : lemon $(>) ;
131   Clean clean : $(<) $(_h) ;
133   # make sure someone includes $(_h) else it will be
134   # a deadly independent target
135   Includes $(<) : $(_h) ;
139 rule UserObject {
140   switch $(>:S) {
141     case .lemon :
142       Cc $(<) : $(<:S=$(YACCGEN)) ;
143       Lemon $(<:S=$(YACCGEN)) : $(>) ;
144   }