| [3845] | 1 | # $Id: Config.kmk 3891 2014-06-29 12:10:20Z bird $ | 
|---|
|  | 2 | ## @file | 
|---|
|  | 3 | # Top-level kBuild configuration. | 
|---|
|  | 4 | # | 
|---|
|  | 5 |  | 
|---|
|  | 6 | # | 
|---|
|  | 7 | # Copyright (c) 2006-2014 knut st. osmundsen <bird@anduin.net> | 
|---|
|  | 8 | # | 
|---|
|  | 9 | # | 
|---|
|  | 10 | # This file is part of kNIX. | 
|---|
|  | 11 | # | 
|---|
|  | 12 | # kNIX is free software; you can redistribute it and/or modify | 
|---|
|  | 13 | # it under the terms of the GNU General Public License as published by | 
|---|
|  | 14 | # the Free Software Foundation; either version 2 of the License, or | 
|---|
|  | 15 | # (at your option) any later version. | 
|---|
|  | 16 | # | 
|---|
|  | 17 | # kNIX is distributed in the hope that it will be useful, | 
|---|
|  | 18 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | 
|---|
|  | 19 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
|---|
|  | 20 | # GNU General Public License for more details. | 
|---|
|  | 21 | # | 
|---|
|  | 22 | # You should have received a copy of the GNU General Public License | 
|---|
|  | 23 | # along with kNIX; if not, write to the Free Software | 
|---|
|  | 24 | # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA | 
|---|
|  | 25 | # | 
|---|
|  | 26 | # | 
|---|
|  | 27 |  | 
|---|
|  | 28 | # | 
|---|
|  | 29 | # Add the packing pass. | 
|---|
|  | 30 | # | 
|---|
|  | 31 | PASSES         += PACKING | 
|---|
|  | 32 | #DEFAULT_PASSES += PACKING | 
|---|
|  | 33 |  | 
|---|
|  | 34 | # | 
|---|
|  | 35 | # This is where we install during the build. | 
|---|
|  | 36 | # | 
|---|
|  | 37 | PATH_INS := $(PATH_OUT)/dist | 
|---|
|  | 38 |  | 
|---|
|  | 39 | # | 
|---|
|  | 40 | # Local config, optional. | 
|---|
|  | 41 | # | 
|---|
|  | 42 | ifneq ($(wildcard $(PATH_ROOT)/LocalConfig.kmk),) | 
|---|
|  | 43 | include $(PATH_ROOT)/LocalConfig.kmk | 
|---|
|  | 44 | endif | 
|---|
|  | 45 |  | 
|---|
|  | 46 |  | 
|---|
|  | 47 |  | 
|---|
|  | 48 | # | 
|---|
|  | 49 | # Base template. | 
|---|
|  | 50 | # | 
|---|
|  | 51 | TEMPLATE_kNIX-base = Base template. | 
|---|
|  | 52 | ifdef CFG_KNIX_USE_WATCOM | 
|---|
|  | 53 | TEMPLATE_kNIX-base_TOOL = OPENWATCOM | 
|---|
| [3891] | 54 | TEMPLATE_kNIX-base_CFLAGS = -za99 -aa -ecc | 
|---|
| [3845] | 55 | else | 
|---|
|  | 56 | TEMPLATE_kNIX-base_TOOL = GCC3 | 
|---|
|  | 57 | TEMPLATE_kNIX-base_TOOL.os2 = GCC3OMF | 
|---|
|  | 58 | endif | 
|---|
|  | 59 |  | 
|---|
|  | 60 | # | 
|---|
|  | 61 | # The /bin templates. | 
|---|
|  | 62 | # | 
|---|
|  | 63 | TEMPLATE_bin = /bin/ programs. | 
|---|
|  | 64 | TEMPLATE_bin_EXTENDS = kNIX-base | 
|---|
|  | 65 | TEMPLATE_bin_INST = bin/ | 
|---|
|  | 66 |  | 
|---|
|  | 67 | # | 
|---|
|  | 68 | # The /usr/bin templates. | 
|---|
|  | 69 | # | 
|---|
|  | 70 | TEMPLATE_usr.bin = /usr/bin/ programs. | 
|---|
|  | 71 | TEMPLATE_usr.bin_EXTENDS = kNIX-base | 
|---|
|  | 72 | TEMPLATE_usr.bin_INST = usr/bin/ | 
|---|
|  | 73 |  | 
|---|
|  | 74 | TEMPLATE_usr.bin.script = /usr/bin/ scripts | 
|---|
|  | 75 | TEMPLATE_usr.bin.script_INST = usr/bin/ | 
|---|
|  | 76 |  | 
|---|
|  | 77 | TEMPLATE_usr.bin.doc = /usr/bin/ program documentation. | 
|---|
|  | 78 | # 1: source  2: target  3: _INST  4: default ins path | 
|---|
|  | 79 | TEMPLATE_usr.bin.doc_INSTFUN = $(4)/usr/doc/$(subst .doc,,$(2))/$(notdir $(1)) | 
|---|
|  | 80 |  | 
|---|
|  | 81 | TEMPLATE_usr.bin.man = /usr/bin/ program manual page | 
|---|
|  | 82 | # 1: source  2: target  3: _INST  4: default ins path | 
|---|
|  | 83 | TEMPLATE_usr.bin.man_INSTFUN = $(4)/usr/man/man$(notdir $(subst .,/,$(1)))/$(notdir $(1)).gz | 
|---|
|  | 84 | # 1: source  2: destination, 3: target | 
|---|
|  | 85 | TEMPLATE_usr.bin.man_INSTALLER = gzip -9 -c $(1) > $(2) | 
|---|
|  | 86 |  | 
|---|
|  | 87 | TEMPLATE_usr.bin.alp = /usr/bin/ libraries using alp as assembler. | 
|---|
|  | 88 | TEMPLATE_usr.bin.alp_EXTENDS = kNIX-base | 
|---|
|  | 89 | TEMPLATE_usr.bin.alp_ASTOOL = ALP | 
|---|
|  | 90 | TEMPLATE_usr.bin.alp_ASFLAGS = -Sv:ALP | 
|---|
|  | 91 | TEMPLATE_usr.bin.alp_INST = usr/bin/ | 
|---|
|  | 92 |  | 
|---|
|  | 93 | TEMPLATE_usr.bin.nasm = /usr/lib/ libraries using nasm as assembler. | 
|---|
|  | 94 | TEMPLATE_usr.bin.nasm_EXTENDS = kNIX-base | 
|---|
|  | 95 | TEMPLATE_usr.bin.nasm_ASTOOL = NASM | 
|---|
|  | 96 | TEMPLATE_usr.bin.nasm_ASFLAGS = -f obj | 
|---|
|  | 97 | TEMPLATE_usr.bin.nasm_INST = usr/bin/ | 
|---|
|  | 98 |  | 
|---|
|  | 99 | # | 
|---|
|  | 100 | # The /usr/sbin templates. | 
|---|
|  | 101 | # | 
|---|
|  | 102 | TEMPLATE_usr.sbin = /usr/sbin/ programs. | 
|---|
|  | 103 | TEMPLATE_usr.sbin_EXTENDS = kNIX-base | 
|---|
|  | 104 | TEMPLATE_usr.sbin_INST = usr/sbin/ | 
|---|
|  | 105 |  | 
|---|
|  | 106 | TEMPLATE_usr.sbin.script = /usr/sbin/ scripts | 
|---|
|  | 107 | TEMPLATE_usr.sbin.script_INST = usr/sbin/ | 
|---|
|  | 108 |  | 
|---|
|  | 109 | TEMPLATE_usr.sbin.doc = /usr/bin/ program documentation. | 
|---|
|  | 110 | # 1: source  2: target  3: _INST  4: default ins path | 
|---|
|  | 111 | TEMPLATE_usr.sbin.doc_INSTFUN = $(4)/usr/doc/$(subst .doc,,$(2))/$(notdir $(1)) | 
|---|
|  | 112 |  | 
|---|
|  | 113 | TEMPLATE_usr.sbin.man = /usr/bin/ program manual page | 
|---|
|  | 114 | # 1: source  2: target  3: _INST  4: default ins path | 
|---|
|  | 115 | TEMPLATE_usr.sbin.man_INSTFUN = $(4)/usr/man/man$(notdir $(subst .,/,$(1)))/$(notdir $(1)).gz | 
|---|
|  | 116 | # 1: source  2: destination, 3: target | 
|---|
|  | 117 | TEMPLATE_usr.sbin.man_INSTALLER = gzip -9 -c $(1) > $(2) | 
|---|
|  | 118 |  | 
|---|
|  | 119 |  | 
|---|
|  | 120 | # | 
|---|
|  | 121 | # The /usr/include templates. | 
|---|
|  | 122 | # | 
|---|
|  | 123 | TEMPLATE_usr.include = /usr/include/ headers | 
|---|
|  | 124 | TEMPLATE_usr.include_INST = usr/include/ | 
|---|
|  | 125 | TEMPLATE_usr.include_MODE = 644 | 
|---|
|  | 126 |  | 
|---|
|  | 127 | TEMPLATE_usr.include.sys = /usr/include/sys/ headers | 
|---|
|  | 128 | TEMPLATE_usr.include.sys_INST = usr/include/sys/ | 
|---|
|  | 129 | TEMPLATE_usr.include.sys_MODE = 644 | 
|---|
|  | 130 |  | 
|---|
|  | 131 |  | 
|---|
|  | 132 | # | 
|---|
|  | 133 | # The /usr/lib templates. | 
|---|
|  | 134 | # | 
|---|
|  | 135 | TEMPLATE_usr.lib = /usr/lib/ libraries. | 
|---|
|  | 136 | TEMPLATE_usr.lib_EXTENDS = kNIX-base | 
|---|
|  | 137 | TEMPLATE_usr.lib_INST = usr/lib/ | 
|---|
|  | 138 | TEMPLATE_usr.lib_MODE = 644 | 
|---|
|  | 139 |  | 
|---|
|  | 140 | TEMPLATE_usr.lib.nasm = /usr/lib/ libraries using nasm as assembler. | 
|---|
|  | 141 | TEMPLATE_usr.lib.nasm_EXTENDS = kNIX-base | 
|---|
|  | 142 | TEMPLATE_usr.lib.nasm_ASTOOL = NASM | 
|---|
|  | 143 | TEMPLATE_usr.lib.nasm_ASFLAGS = -f obj | 
|---|
|  | 144 | TEMPLATE_usr.lib.nasm_INST = usr/lib/ | 
|---|
|  | 145 | TEMPLATE_usr.lib.nasm_MODE = 644 | 
|---|
|  | 146 |  | 
|---|
|  | 147 |  | 
|---|
|  | 148 | # | 
|---|
|  | 149 | # The generic data install template. | 
|---|
|  | 150 | # | 
|---|
|  | 151 | TEMPLATE_gendata = generic data installation template. | 
|---|
|  | 152 | TEMPLATE_gendata_INST = /tmp | 
|---|
|  | 153 | TEMPLATE_gendata_MODE = 644 | 
|---|
|  | 154 |  | 
|---|
|  | 155 | # | 
|---|
|  | 156 | # The generic script install template. | 
|---|
|  | 157 | # | 
|---|
|  | 158 | TEMPLATE_genscript = generic script installation template. | 
|---|
|  | 159 | TEMPLATE_genscript_INST = /tmp | 
|---|
|  | 160 | TEMPLATE_genscript_MODE = 755 | 
|---|
|  | 161 |  | 
|---|
|  | 162 |  | 
|---|
|  | 163 | # | 
|---|
|  | 164 | # The default way of packing. | 
|---|
|  | 165 | # We install to packages/<subdir>, then we zip up what's there. | 
|---|
|  | 166 | # | 
|---|
|  | 167 | PACKAGE_ZIP  ?= $(PATH_OUT)/packages/$(CURSUBDIR).zip | 
|---|
|  | 168 | PATH_PACKAGE ?= $(PATH_OUT)/packages/$(CURSUBDIR) | 
|---|
|  | 169 | PACKING      ?= defaultpacking | 
|---|
|  | 170 | defaultpacking: | 
|---|
|  | 171 | $(RM) -f "$(PACKAGE_ZIP)" | 
|---|
|  | 172 | $(RM) -Rf "$(PATH_PACKAGE)" | 
|---|
|  | 173 | +$(MAKE) "PATH_INS=$(PATH_PACKAGE)" install | 
|---|
|  | 174 | cd "$(PATH_PACKAGE)/" && zip -9r $(PATH_OUT)/packages/$(CURSUBDIR).zip * | 
|---|
|  | 175 | .NOTPARALLEL: defaultpacking | 
|---|
|  | 176 | # todo zip up the source and create a diff. | 
|---|
|  | 177 |  | 
|---|
|  | 178 |  | 
|---|