pkg-config is now configurable
[k8jam.git] / Jamrules
blob24d44cc8e81f84b9654581bf0f6ce64cb416ee01
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 ; }
20 if $(RE9DBGMEM) { DEFINES += REGEXP9_DEBUG_MEMSIZE ; }
22 set-profile ;
23 set-target-locations ;
24 gcc-suggest-attrs ;
27 #if ! $(PREFIX) { PREFIX = /usr/local ; }
29 include $(TOP)/Jamrules.configure ;
32 # note that we use the target directory 'bin.unix' to ensure that
33 # 'make install' and 'make uninstall' work correctly
34 if $(UNIX) {
35   #if ! $(LOCATE_TARGET) { LOCATE_TARGET = bin.unix/obj ; }
36   ALL_LOCATE_BIN = $(TOP)/bin.unix ;
37 } else {
38   #if ! $(LOCATE_TARGET) { LOCATE_TARGET = bin.$(OSFULL[1]:L)$(PATH_SEPARATOR)obj ; }
39   ALL_LOCATE_BIN = $(TOP)$(PATH_SEPARATOR)bin.$(OSFULL[1]:L) ;
42 # Leave generated source in current directory; it would be nice to use
43 # these lines below to build the source into the platform-specific
44 # directory, but getting scan.c to include the right jambase.h is
45 # hard: with ""'s, it always gets the bootstrap version; with <>'s,
46 # it won't find the bootstrap version.
48 # SEARCH_SOURCE ?= $(LOCATE_TARGET) $(DOT) ;
49 # LOCATE_SOURCE ?= $(LOCATE_TARGET) ;
51 # For some really stupid reason, classic Jam doesn't define NT
52 # when compiling with Mingw, but the variable MINGW instead..
54 if ! $(NT) && $(MINGW) {
55   NT = 1 ;
56   JAM_TOOLSET = MINGW ;
59 if $(UNIX) && $(OS) = CYGWIN {
60   CCFLAGS += -D__cygwin__ ;
64 # We have to signal jam.h for these
65 if $(OS) = NT {
66   switch $(JAM_TOOLSET) {
67     case MINGW       : CCFLAGS += -DNT ;
68     case LCC         : CCFLAGS += -DNT ;
69     case DIGITALMARS : CCFLAGS += -DNT ;
70     case *           : CCFLAGS += /DNT ;
71   }
75 if ! $(DEBUG) && ! $(VALGRIND) {
76   if $(UNIX) {
77     actions Strip {
78       strip -s $(1)
79     }
80   }
81   # Strip the Jam executable on Mingw
82   if $(JAM_TOOLSET) = MINGW {
83     actions Strip {
84       strip $(1)
85     }
86   }
90 # installing
91 #if $(UNIX) {
92   #if $(DESTDIR) { INSTALLDIR_PREFIX = $(DESTDIR)$(PREFIX) ; } else { INSTALLDIR_PREFIX = $(PREFIX) ; }
93   #INSTALLDIR_BIN = $(INSTALLDIR_PREFIX)/bin ;
94   #INSTALLDIR_MAN = $(INSTALLDIR_PREFIX)/man ;
95   #INSTALLDIR_DOCS = $(INSTALLDIR_PREFIX)/share/doc/$(VERSION) ;
99 # this was needed 'cause (LOCATE_SOURCE) was targeted there
100 #HDRS += $(ALL_LOCATE_TARGET)/src ;
103 actions quietly AShowHelp {
104   echo "usage: k8jam [target] [flags]"
105   echo "targets:"
106   echo "  all/<empty>  -- build"
107   #echo "  push         -- push to external git repository"
110 #InstallBin bin : jam ;
112 softinclude $(TOP)/Jamrules.local ;
113 softinclude $(TOP)/Jamrules.push ;
114 softinclude $(TOP)/Jamrules.install ;
117 rule Lemon {
118   local _h ;
120   _h = $(<:BS=.h) ;
122   ### Echo "Lemon: <:" $(<) ;
123   ### Echo "Lemon: >:" $(>) ;
124   ### Echo "hdr     :" $(<:S=.h) ;
125   ### Exit "!" ;
127   MakeLocate $(<) $(_h) $(>) : $(LOCATE_SOURCE) ;
128   #MakeLocate $(>) $(_h) : $(LOCATE_SOURCE) ;
130   Depends $(<) : $(>) ;
131   Depends $(<:S=.h) : $(<) ;
132   GenFile $(<) : lemon -q "*$(>)" : $(>) ;
133   Clean clean : $(<) $(_h) ;
137 rule UserObject {
138   switch $(>:S) {
139     case .lemon :
140       Cc $(<) : $(<:S=$(YACCGEN)) ;
141       Lemon $(<:S=$(YACCGEN)) : $(>) ;
142   }