# $Id$ ## @file # Top-level kBuild configuration. # # # Copyright (c) 2006-2014 knut st. osmundsen # # # This file is part of kNIX. # # kNIX is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # kNIX is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with kNIX; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # # # # Add the packing pass. # PASSES += PACKING #DEFAULT_PASSES += PACKING # # This is where we install during the build. # PATH_INS := $(PATH_OUT)/dist # # Local config, optional. # ifneq ($(wildcard $(PATH_ROOT)/LocalConfig.kmk),) include $(PATH_ROOT)/LocalConfig.kmk endif # # Base template. # TEMPLATE_kNIX-base = Base template. ifdef CFG_KNIX_USE_WATCOM TEMPLATE_kNIX-base_TOOL = OPENWATCOM TEMPLATE_kNIX-base_CFLAGS = -za99 -aa -ecc else TEMPLATE_kNIX-base_TOOL = GCC3 TEMPLATE_kNIX-base_TOOL.os2 = GCC3OMF endif # # The /bin templates. # TEMPLATE_bin = /bin/ programs. TEMPLATE_bin_EXTENDS = kNIX-base TEMPLATE_bin_INST = bin/ # # The /usr/bin templates. # TEMPLATE_usr.bin = /usr/bin/ programs. TEMPLATE_usr.bin_EXTENDS = kNIX-base TEMPLATE_usr.bin_INST = usr/bin/ TEMPLATE_usr.bin.script = /usr/bin/ scripts TEMPLATE_usr.bin.script_INST = usr/bin/ TEMPLATE_usr.bin.doc = /usr/bin/ program documentation. # 1: source 2: target 3: _INST 4: default ins path TEMPLATE_usr.bin.doc_INSTFUN = $(4)/usr/doc/$(subst .doc,,$(2))/$(notdir $(1)) TEMPLATE_usr.bin.man = /usr/bin/ program manual page # 1: source 2: target 3: _INST 4: default ins path TEMPLATE_usr.bin.man_INSTFUN = $(4)/usr/man/man$(notdir $(subst .,/,$(1)))/$(notdir $(1)).gz # 1: source 2: destination, 3: target TEMPLATE_usr.bin.man_INSTALLER = gzip -9 -c $(1) > $(2) TEMPLATE_usr.bin.alp = /usr/bin/ libraries using alp as assembler. TEMPLATE_usr.bin.alp_EXTENDS = kNIX-base TEMPLATE_usr.bin.alp_ASTOOL = ALP TEMPLATE_usr.bin.alp_ASFLAGS = -Sv:ALP TEMPLATE_usr.bin.alp_INST = usr/bin/ TEMPLATE_usr.bin.nasm = /usr/lib/ libraries using nasm as assembler. TEMPLATE_usr.bin.nasm_EXTENDS = kNIX-base TEMPLATE_usr.bin.nasm_ASTOOL = NASM TEMPLATE_usr.bin.nasm_ASFLAGS = -f obj TEMPLATE_usr.bin.nasm_INST = usr/bin/ # # The /usr/sbin templates. # TEMPLATE_usr.sbin = /usr/sbin/ programs. TEMPLATE_usr.sbin_EXTENDS = kNIX-base TEMPLATE_usr.sbin_INST = usr/sbin/ TEMPLATE_usr.sbin.script = /usr/sbin/ scripts TEMPLATE_usr.sbin.script_INST = usr/sbin/ TEMPLATE_usr.sbin.doc = /usr/bin/ program documentation. # 1: source 2: target 3: _INST 4: default ins path TEMPLATE_usr.sbin.doc_INSTFUN = $(4)/usr/doc/$(subst .doc,,$(2))/$(notdir $(1)) TEMPLATE_usr.sbin.man = /usr/bin/ program manual page # 1: source 2: target 3: _INST 4: default ins path TEMPLATE_usr.sbin.man_INSTFUN = $(4)/usr/man/man$(notdir $(subst .,/,$(1)))/$(notdir $(1)).gz # 1: source 2: destination, 3: target TEMPLATE_usr.sbin.man_INSTALLER = gzip -9 -c $(1) > $(2) # # The /usr/include templates. # TEMPLATE_usr.include = /usr/include/ headers TEMPLATE_usr.include_INST = usr/include/ TEMPLATE_usr.include_MODE = 644 TEMPLATE_usr.include.sys = /usr/include/sys/ headers TEMPLATE_usr.include.sys_INST = usr/include/sys/ TEMPLATE_usr.include.sys_MODE = 644 # # The /usr/lib templates. # TEMPLATE_usr.lib = /usr/lib/ libraries. TEMPLATE_usr.lib_EXTENDS = kNIX-base TEMPLATE_usr.lib_INST = usr/lib/ TEMPLATE_usr.lib_MODE = 644 TEMPLATE_usr.lib.nasm = /usr/lib/ libraries using nasm as assembler. TEMPLATE_usr.lib.nasm_EXTENDS = kNIX-base TEMPLATE_usr.lib.nasm_ASTOOL = NASM TEMPLATE_usr.lib.nasm_ASFLAGS = -f obj TEMPLATE_usr.lib.nasm_INST = usr/lib/ TEMPLATE_usr.lib.nasm_MODE = 644 # # The generic data install template. # TEMPLATE_gendata = generic data installation template. TEMPLATE_gendata_INST = /tmp TEMPLATE_gendata_MODE = 644 # # The generic script install template. # TEMPLATE_genscript = generic script installation template. TEMPLATE_genscript_INST = /tmp TEMPLATE_genscript_MODE = 755 # # The default way of packing. # We install to packages/, then we zip up what's there. # PACKAGE_ZIP ?= $(PATH_OUT)/packages/$(CURSUBDIR).zip PATH_PACKAGE ?= $(PATH_OUT)/packages/$(CURSUBDIR) PACKING ?= defaultpacking defaultpacking: $(RM) -f "$(PACKAGE_ZIP)" $(RM) -Rf "$(PATH_PACKAGE)" +$(MAKE) "PATH_INS=$(PATH_PACKAGE)" install cd "$(PATH_PACKAGE)/" && zip -9r $(PATH_OUT)/packages/$(CURSUBDIR).zip * .NOTPARALLEL: defaultpacking # todo zip up the source and create a diff.