annotate Makefile @ 487:5616a3d38d8e

[mq]: cross-ports
author Aleksandr Rybalko <ray@ddteam.net>
date Fri, 02 Nov 2012 15:36:00 +0200
parents 76203decdeef
children 1086b5f8d703
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
8
853f1379ffd2 build system save point
ray
parents: 4
diff changeset
1
853f1379ffd2 build system save point
ray
parents: 4
diff changeset
2 .include <bsd.own.mk>
853f1379ffd2 build system save point
ray
parents: 4
diff changeset
3
315
eb82a92a14b5 Introduce local options file ${ZROUTER_ROOT}/Makefile.local.opts
ray@terran.dlink.ua
parents: 310
diff changeset
4 # ZROUTER_ROOT can be set in environment
eb82a92a14b5 Introduce local options file ${ZROUTER_ROOT}/Makefile.local.opts
ray@terran.dlink.ua
parents: 310
diff changeset
5 .if !defined(ZROUTER_ROOT)
eb82a92a14b5 Introduce local options file ${ZROUTER_ROOT}/Makefile.local.opts
ray@terran.dlink.ua
parents: 310
diff changeset
6 ZROUTER_ROOT=${.CURDIR}
eb82a92a14b5 Introduce local options file ${ZROUTER_ROOT}/Makefile.local.opts
ray@terran.dlink.ua
parents: 310
diff changeset
7 .endif
eb82a92a14b5 Introduce local options file ${ZROUTER_ROOT}/Makefile.local.opts
ray@terran.dlink.ua
parents: 310
diff changeset
8
eb82a92a14b5 Introduce local options file ${ZROUTER_ROOT}/Makefile.local.opts
ray@terran.dlink.ua
parents: 310
diff changeset
9 .if exists(${ZROUTER_ROOT}/Makefile.local.opts)
eb82a92a14b5 Introduce local options file ${ZROUTER_ROOT}/Makefile.local.opts
ray@terran.dlink.ua
parents: 310
diff changeset
10 .warning Using options from ${ZROUTER_ROOT}/Makefile.local.opts
eb82a92a14b5 Introduce local options file ${ZROUTER_ROOT}/Makefile.local.opts
ray@terran.dlink.ua
parents: 310
diff changeset
11 .include "${ZROUTER_ROOT}/Makefile.local.opts"
eb82a92a14b5 Introduce local options file ${ZROUTER_ROOT}/Makefile.local.opts
ray@terran.dlink.ua
parents: 310
diff changeset
12 .endif
eb82a92a14b5 Introduce local options file ${ZROUTER_ROOT}/Makefile.local.opts
ray@terran.dlink.ua
parents: 310
diff changeset
13
245
67a983f45f57 Fetch version variables for FreeBSD source tree and break the build if source
ray@terran.dlink.ua
parents: 238
diff changeset
14 #
67a983f45f57 Fetch version variables for FreeBSD source tree and break the build if source
ray@terran.dlink.ua
parents: 238
diff changeset
15 # Defaults
67a983f45f57 Fetch version variables for FreeBSD source tree and break the build if source
ray@terran.dlink.ua
parents: 238
diff changeset
16 #
13
d8bb9c177242 savepoint kernel build rework
ray
parents: 12
diff changeset
17 FREEBSD_SRC_TREE?=/usr/src
124
c0b11789d01c hide /usr/obj in variable OBJ_DIR. user can change it
ray@terran.dlink.ua
parents: 123
diff changeset
18 OBJ_DIR?=/usr/obj
1
e95e41e96364 basic Makefiles for devices profiles
ray
parents:
diff changeset
19
245
67a983f45f57 Fetch version variables for FreeBSD source tree and break the build if source
ray@terran.dlink.ua
parents: 238
diff changeset
20 #
67a983f45f57 Fetch version variables for FreeBSD source tree and break the build if source
ray@terran.dlink.ua
parents: 238
diff changeset
21 # Check access to FreeBSD source tree and fetch version variables
67a983f45f57 Fetch version variables for FreeBSD source tree and break the build if source
ray@terran.dlink.ua
parents: 238
diff changeset
22 #
67a983f45f57 Fetch version variables for FreeBSD source tree and break the build if source
ray@terran.dlink.ua
parents: 238
diff changeset
23 .if exists(${FREEBSD_SRC_TREE}/sys/conf/newvers.sh)
67a983f45f57 Fetch version variables for FreeBSD source tree and break the build if source
ray@terran.dlink.ua
parents: 238
diff changeset
24 FREEBSD_VERSION_VARS!=grep -E '(TYPE|REVISION|BRANCH)=\"' \
67a983f45f57 Fetch version variables for FreeBSD source tree and break the build if source
ray@terran.dlink.ua
parents: 238
diff changeset
25 ${FREEBSD_SRC_TREE}/sys/conf/newvers.sh | sed 's/\"//g'
67a983f45f57 Fetch version variables for FreeBSD source tree and break the build if source
ray@terran.dlink.ua
parents: 238
diff changeset
26 .for var in ${FREEBSD_VERSION_VARS}
67a983f45f57 Fetch version variables for FreeBSD source tree and break the build if source
ray@terran.dlink.ua
parents: 238
diff changeset
27 FREEBSD_${var}
67a983f45f57 Fetch version variables for FreeBSD source tree and break the build if source
ray@terran.dlink.ua
parents: 238
diff changeset
28 .endfor
67a983f45f57 Fetch version variables for FreeBSD source tree and break the build if source
ray@terran.dlink.ua
parents: 238
diff changeset
29 FREEBSD_RELEASE=${FREEBSD_TYPE}-${FREEBSD_REVISION}-${FREEBSD_BRANCH}
67a983f45f57 Fetch version variables for FreeBSD source tree and break the build if source
ray@terran.dlink.ua
parents: 238
diff changeset
30 .else
67a983f45f57 Fetch version variables for FreeBSD source tree and break the build if source
ray@terran.dlink.ua
parents: 238
diff changeset
31 .error "missing FreeBSD source tree: FREEBSD_SRC_TREE=${FREEBSD_SRC_TREE}"
67a983f45f57 Fetch version variables for FreeBSD source tree and break the build if source
ray@terran.dlink.ua
parents: 238
diff changeset
32 .endif
67a983f45f57 Fetch version variables for FreeBSD source tree and break the build if source
ray@terran.dlink.ua
parents: 238
diff changeset
33
8
853f1379ffd2 build system save point
ray
parents: 4
diff changeset
34 # ZROUTER_OBJ can be set in environment
124
c0b11789d01c hide /usr/obj in variable OBJ_DIR. user can change it
ray@terran.dlink.ua
parents: 123
diff changeset
35 ZROUTER_OBJ?=${OBJ_DIR}/${ZROUTER_ROOT}
c0b11789d01c hide /usr/obj in variable OBJ_DIR. user can change it
ray@terran.dlink.ua
parents: 123
diff changeset
36 MAKEOBJDIRPREFIX?=${OBJ_DIR}/${ZROUTER_ROOT}/
8
853f1379ffd2 build system save point
ray
parents: 4
diff changeset
37 KERNELBUILDDIR?=${ZROUTER_OBJ}/kernel
853f1379ffd2 build system save point
ray
parents: 4
diff changeset
38 KERNELCONFDIR?=${ZROUTER_OBJ}/conf
15
73b96233b7e3 kernel build/install done, and cleaned
ray@terran.dlink.ua
parents: 14
diff changeset
39 KERNELDESTDIR=${ZROUTER_OBJ}/${TARGET_VENDOR}_${TARGET_DEVICE}_rootfs
17
6f4762ee242a savepoint: world
ray
parents: 16
diff changeset
40 WORLDDESTDIR=${ZROUTER_OBJ}/${TARGET_VENDOR}_${TARGET_DEVICE}_rootfs
19
b0ce362d3832 tuning profiles, docs
ray
parents: 18
diff changeset
41 SRCROOTUP!=${ZROUTER_ROOT}/tools/rootup.sh ${FREEBSD_SRC_TREE}
321
4445eeeff278 Tidy up main Makefile. make lines shortest.
ray@terran.dlink.ua
parents: 315
diff changeset
42 TARGET_CPUARCH?=${TARGET}
21
b100581fd932 savepoint ports
ray@terran.dlink.ua
parents: 20
diff changeset
43
202
02c1a507ea30 Allow to specify TARGET_CPUARCH in soc.mk or board.mk
ray@terran.dlink.ua
parents: 201
diff changeset
44
95
91ceb933eeff ADAPTATION rc.d script example
ray@terran.dlink.ua
parents: 93
diff changeset
45 # XXX Need found something better or use per profile
91ceb933eeff ADAPTATION rc.d script example
ray@terran.dlink.ua
parents: 93
diff changeset
46 ROOTFS_DEPTEST?=${WORLDDESTDIR}/bin/sh
91ceb933eeff ADAPTATION rc.d script example
ray@terran.dlink.ua
parents: 93
diff changeset
47
105
ray@terran.dlink.ua
parents: 96
diff changeset
48 KERNEL_SIZE_MAX!=sh -c 'echo $$((8 * 1024 * 1024))'
113
f0f44909f9dd lua-web++
ray@terran.dlink.ua
parents: 105
diff changeset
49 PREINSTALLDIRS=/lib
105
ray@terran.dlink.ua
parents: 96
diff changeset
50
366
462445ce9207 (Clean|Tidy)up, prepare for updated menu.sh
ray@terran.dlink.ua
parents: 353
diff changeset
51 ##############################################################################
147
8ff9b4cc25d5 Add contrib/racoon2, target/sbin/racoon2 - fast way to have worked IPSec
ray@terran.dlink.ua
parents: 138
diff changeset
52 # Board configuration must define used SoC/CPU
366
462445ce9207 (Clean|Tidy)up, prepare for updated menu.sh
ray@terran.dlink.ua
parents: 353
diff changeset
53 ##############################################################################
1
e95e41e96364 basic Makefiles for devices profiles
ray
parents:
diff changeset
54 .include "boards/boards.mk"
e95e41e96364 basic Makefiles for devices profiles
ray
parents:
diff changeset
55
366
462445ce9207 (Clean|Tidy)up, prepare for updated menu.sh
ray@terran.dlink.ua
parents: 353
diff changeset
56 .if !defined(TARGET_BOARDDIR)
462445ce9207 (Clean|Tidy)up, prepare for updated menu.sh
ray@terran.dlink.ua
parents: 353
diff changeset
57 TARGET_PAIRS!=ls -d ${ZROUTER_ROOT}/boards/*/* | sed 's/^.*\/boards\///'
462445ce9207 (Clean|Tidy)up, prepare for updated menu.sh
ray@terran.dlink.ua
parents: 353
diff changeset
58 .endif
462445ce9207 (Clean|Tidy)up, prepare for updated menu.sh
ray@terran.dlink.ua
parents: 353
diff changeset
59
462445ce9207 (Clean|Tidy)up, prepare for updated menu.sh
ray@terran.dlink.ua
parents: 353
diff changeset
60 menu:
462445ce9207 (Clean|Tidy)up, prepare for updated menu.sh
ray@terran.dlink.ua
parents: 353
diff changeset
61 @/usr/bin/env ZROUTER_ROOT="${ZROUTER_ROOT}" ${ZROUTER_ROOT}/menu.sh
462445ce9207 (Clean|Tidy)up, prepare for updated menu.sh
ray@terran.dlink.ua
parents: 353
diff changeset
62
462445ce9207 (Clean|Tidy)up, prepare for updated menu.sh
ray@terran.dlink.ua
parents: 353
diff changeset
63 show-target-pairs:
462445ce9207 (Clean|Tidy)up, prepare for updated menu.sh
ray@terran.dlink.ua
parents: 353
diff changeset
64 @echo "${TARGET_PAIRS}"
462445ce9207 (Clean|Tidy)up, prepare for updated menu.sh
ray@terran.dlink.ua
parents: 353
diff changeset
65
462445ce9207 (Clean|Tidy)up, prepare for updated menu.sh
ray@terran.dlink.ua
parents: 353
diff changeset
66 ##############################################################################
2
4a1341512ca8 Add SoC layout, soc.mk set defaults for SoC used in board
ray@terran.dlink.ua
parents: 1
diff changeset
67 # Set SoC defaults based on SOC_VENDOR/SOC_CHIP
366
462445ce9207 (Clean|Tidy)up, prepare for updated menu.sh
ray@terran.dlink.ua
parents: 353
diff changeset
68 ##############################################################################
2
4a1341512ca8 Add SoC layout, soc.mk set defaults for SoC used in board
ray@terran.dlink.ua
parents: 1
diff changeset
69 .include "socs/socs.mk"
4a1341512ca8 Add SoC layout, soc.mk set defaults for SoC used in board
ray@terran.dlink.ua
parents: 1
diff changeset
70
321
4445eeeff278 Tidy up main Makefile. make lines shortest.
ray@terran.dlink.ua
parents: 315
diff changeset
71 .if ${MACHINE} == ${TARGET} && ${MACHINE_ARCH} == ${TARGET_ARCH} && !defined(CROSS_BUILD_TESTING)
4445eeeff278 Tidy up main Makefile. make lines shortest.
ray@terran.dlink.ua
parents: 315
diff changeset
72 TARGET_ARCH_SUBDIR= ""
4445eeeff278 Tidy up main Makefile. make lines shortest.
ray@terran.dlink.ua
parents: 315
diff changeset
73 .else
4445eeeff278 Tidy up main Makefile. make lines shortest.
ray@terran.dlink.ua
parents: 315
diff changeset
74 TARGET_ARCH_SUBDIR= ${TARGET}.${TARGET_ARCH}
4445eeeff278 Tidy up main Makefile. make lines shortest.
ray@terran.dlink.ua
parents: 315
diff changeset
75 .endif
4445eeeff278 Tidy up main Makefile. make lines shortest.
ray@terran.dlink.ua
parents: 315
diff changeset
76 ZROUTER_FREEBSD_OBJDIR=${ZROUTER_OBJ}/tmp/${TARGET_ARCH_SUBDIR}/${FREEBSD_SRC_TREE}
4445eeeff278 Tidy up main Makefile. make lines shortest.
ray@terran.dlink.ua
parents: 315
diff changeset
77
413
302831d00c8b Add comment how to switch to more correct way for saving board/soc names for
Aleksandr Rybalko <ray@ddteam.net>
parents: 408
diff changeset
78 # XXX bad idea, because require changes to system code
302831d00c8b Add comment how to switch to more correct way for saving board/soc names for
Aleksandr Rybalko <ray@ddteam.net>
parents: 408
diff changeset
79 # Better to define it in hints, then fetch by KENV
392
67a61a0c4cdb * Add SKIP_WORLD_INSTALL to not touch world stages (fast kernel rebuild)
Aleksandr Rybalko <ray@ddteam.net>
parents: 372
diff changeset
80 KERNCONF_OPTIONS+= SOC_VENDOR=\\\"${SOC_VENDOR}\\\"
67a61a0c4cdb * Add SKIP_WORLD_INSTALL to not touch world stages (fast kernel rebuild)
Aleksandr Rybalko <ray@ddteam.net>
parents: 372
diff changeset
81 KERNCONF_OPTIONS+= SOC_MODEL=\\\"${SOC_CHIP}\\\"
67a61a0c4cdb * Add SKIP_WORLD_INSTALL to not touch world stages (fast kernel rebuild)
Aleksandr Rybalko <ray@ddteam.net>
parents: 372
diff changeset
82 .if defined(SOC_REVISION)
67a61a0c4cdb * Add SKIP_WORLD_INSTALL to not touch world stages (fast kernel rebuild)
Aleksandr Rybalko <ray@ddteam.net>
parents: 372
diff changeset
83 KERNCONF_OPTIONS+= SOC_REV=\\\"${SOC_REVISION}\\\"
67a61a0c4cdb * Add SKIP_WORLD_INSTALL to not touch world stages (fast kernel rebuild)
Aleksandr Rybalko <ray@ddteam.net>
parents: 372
diff changeset
84 .endif
67a61a0c4cdb * Add SKIP_WORLD_INSTALL to not touch world stages (fast kernel rebuild)
Aleksandr Rybalko <ray@ddteam.net>
parents: 372
diff changeset
85 KERNCONF_OPTIONS+= DEVICE_VENDOR=\\\"${TARGET_VENDOR}\\\"
67a61a0c4cdb * Add SKIP_WORLD_INSTALL to not touch world stages (fast kernel rebuild)
Aleksandr Rybalko <ray@ddteam.net>
parents: 372
diff changeset
86 KERNCONF_OPTIONS+= DEVICE_MODEL=\\\"${TARGET_DEVICE}\\\"
67a61a0c4cdb * Add SKIP_WORLD_INSTALL to not touch world stages (fast kernel rebuild)
Aleksandr Rybalko <ray@ddteam.net>
parents: 372
diff changeset
87 .if defined(BOARD_REVISION)
67a61a0c4cdb * Add SKIP_WORLD_INSTALL to not touch world stages (fast kernel rebuild)
Aleksandr Rybalko <ray@ddteam.net>
parents: 372
diff changeset
88 KERNCONF_OPTIONS+= DEVICE_REV=\\\"${BOARD_REVISION}\\\"
67a61a0c4cdb * Add SKIP_WORLD_INSTALL to not touch world stages (fast kernel rebuild)
Aleksandr Rybalko <ray@ddteam.net>
parents: 372
diff changeset
89 .endif
67a61a0c4cdb * Add SKIP_WORLD_INSTALL to not touch world stages (fast kernel rebuild)
Aleksandr Rybalko <ray@ddteam.net>
parents: 372
diff changeset
90
414
72546c42ea52 No swapping by default.
Aleksandr Rybalko <ray@ddteam.net>
parents: 413
diff changeset
91 KERNCONF_OPTIONS+= NO_SWAPPING
72546c42ea52 No swapping by default.
Aleksandr Rybalko <ray@ddteam.net>
parents: 413
diff changeset
92
256
a04a4ecc8470 define ubntimage target to build RS/RSPRO firmware
ray@terran.dlink.ua
parents: 254
diff changeset
93 KERNCONF_MAKEOPTIONS+= "KERNLOADADDR=${KERNCONF_KERNLOADADDR}"
307
806cb53de7f7 Define and use new variable KERNCONF_KERN_LDSCRIPT_NAME variable.
ray@terran.dlink.ua
parents: 305
diff changeset
94 # Allow to undefine LDSCRIPT_NAME if (board|soc).mk was set it to ""
806cb53de7f7 Define and use new variable KERNCONF_KERN_LDSCRIPT_NAME variable.
ray@terran.dlink.ua
parents: 305
diff changeset
95 .if !empty(KERNCONF_KERN_LDSCRIPT_NAME)
806cb53de7f7 Define and use new variable KERNCONF_KERN_LDSCRIPT_NAME variable.
ray@terran.dlink.ua
parents: 305
diff changeset
96 KERNCONF_MAKEOPTIONS+= "LDSCRIPT_NAME=${KERNCONF_KERN_LDSCRIPT_NAME}"
806cb53de7f7 Define and use new variable KERNCONF_KERN_LDSCRIPT_NAME variable.
ray@terran.dlink.ua
parents: 305
diff changeset
97 .endif
806cb53de7f7 Define and use new variable KERNCONF_KERN_LDSCRIPT_NAME variable.
ray@terran.dlink.ua
parents: 305
diff changeset
98
256
a04a4ecc8470 define ubntimage target to build RS/RSPRO firmware
ray@terran.dlink.ua
parents: 254
diff changeset
99
292
3bde1243f404 Expand 'K' and 'M' suffixes in BOARD_FLASH_SIZE variable.
ray@terran.dlink.ua
parents: 275
diff changeset
100 # resolve board flash size with trailing M or K
3bde1243f404 Expand 'K' and 'M' suffixes in BOARD_FLASH_SIZE variable.
ray@terran.dlink.ua
parents: 275
diff changeset
101 .if defined(BOARD_FLASH_SIZE)
3bde1243f404 Expand 'K' and 'M' suffixes in BOARD_FLASH_SIZE variable.
ray@terran.dlink.ua
parents: 275
diff changeset
102 BOARD_FLASH_SIZE!=echo "${BOARD_FLASH_SIZE}" | \
3bde1243f404 Expand 'K' and 'M' suffixes in BOARD_FLASH_SIZE variable.
ray@terran.dlink.ua
parents: 275
diff changeset
103 sed -e 's/0x/ibase=16; /' -e 's/K/ * 1024/' -e 's/M/ * 1024 * 1024/' | bc
3bde1243f404 Expand 'K' and 'M' suffixes in BOARD_FLASH_SIZE variable.
ray@terran.dlink.ua
parents: 275
diff changeset
104 .endif
3bde1243f404 Expand 'K' and 'M' suffixes in BOARD_FLASH_SIZE variable.
ray@terran.dlink.ua
parents: 275
diff changeset
105
249
f09dd113530c Set default profile.
ray@terran.dlink.ua
parents: 245
diff changeset
106 .if !defined(TARGET_PROFILES) || empty(TARGET_PROFILES)
f09dd113530c Set default profile.
ray@terran.dlink.ua
parents: 245
diff changeset
107 # if we have flash and it size less than 8M assign profile xSMALL_
f09dd113530c Set default profile.
ray@terran.dlink.ua
parents: 245
diff changeset
108 .if defined(BOARD_FLASH_SIZE) && !empty(BOARD_FLASH_SIZE) && ${BOARD_FLASH_SIZE} < 8388608
f09dd113530c Set default profile.
ray@terran.dlink.ua
parents: 245
diff changeset
109 TARGET_PROFILES=xSMALL_
f09dd113530c Set default profile.
ray@terran.dlink.ua
parents: 245
diff changeset
110 .else
f09dd113530c Set default profile.
ray@terran.dlink.ua
parents: 245
diff changeset
111 TARGET_PROFILES=SMALL_
f09dd113530c Set default profile.
ray@terran.dlink.ua
parents: 245
diff changeset
112 .endif
f09dd113530c Set default profile.
ray@terran.dlink.ua
parents: 245
diff changeset
113 .endif # !defined(TARGET_PROFILES) || empty(TARGET_PROFILES)
f09dd113530c Set default profile.
ray@terran.dlink.ua
parents: 245
diff changeset
114
353
786c8d9ac9fd Add make target target-profiles-list, to know which profiles built by default for board
ray@terran.dlink.ua
parents: 335
diff changeset
115 target-profiles-list:
786c8d9ac9fd Add make target target-profiles-list, to know which profiles built by default for board
ray@terran.dlink.ua
parents: 335
diff changeset
116 @echo ${TARGET_PROFILES}
786c8d9ac9fd Add make target target-profiles-list, to know which profiles built by default for board
ray@terran.dlink.ua
parents: 335
diff changeset
117
366
462445ce9207 (Clean|Tidy)up, prepare for updated menu.sh
ray@terran.dlink.ua
parents: 353
diff changeset
118 ##############################################################################
4
c933ff2ea376 profiles layout, user or board config can set many profiles (minimal SMALL_, +openvpn, +racoon etc.), then build must check size with board flash size
ray@terran.dlink.ua
parents: 2
diff changeset
119 # Profiles - set of SUBDIRS that need to build
366
462445ce9207 (Clean|Tidy)up, prepare for updated menu.sh
ray@terran.dlink.ua
parents: 353
diff changeset
120 ##############################################################################
4
c933ff2ea376 profiles layout, user or board config can set many profiles (minimal SMALL_, +openvpn, +racoon etc.), then build must check size with board flash size
ray@terran.dlink.ua
parents: 2
diff changeset
121 .include "profiles/profiles.mk"
222
7ee7ba190a98 Ability to fix alignment for images with headers like TRX
ray@terran.dlink.ua
parents: 202
diff changeset
122
438
76203decdeef Move .include "vendor/vendor.mk" to the right place. (Make it last)
Aleksandr Rybalko <ray@ddteam.net>
parents: 437
diff changeset
123 ##############################################################################
76203decdeef Move .include "vendor/vendor.mk" to the right place. (Make it last)
Aleksandr Rybalko <ray@ddteam.net>
parents: 437
diff changeset
124 # Local vendor changes
76203decdeef Move .include "vendor/vendor.mk" to the right place. (Make it last)
Aleksandr Rybalko <ray@ddteam.net>
parents: 437
diff changeset
125 ##############################################################################
76203decdeef Move .include "vendor/vendor.mk" to the right place. (Make it last)
Aleksandr Rybalko <ray@ddteam.net>
parents: 437
diff changeset
126 .include "vendor/vendor.mk"
76203decdeef Move .include "vendor/vendor.mk" to the right place. (Make it last)
Aleksandr Rybalko <ray@ddteam.net>
parents: 437
diff changeset
127
222
7ee7ba190a98 Ability to fix alignment for images with headers like TRX
ray@terran.dlink.ua
parents: 202
diff changeset
128 .if defined(IMAGE_TYPE) && ${IMAGE_TYPE} == "trx"
7ee7ba190a98 Ability to fix alignment for images with headers like TRX
ray@terran.dlink.ua
parents: 202
diff changeset
129 IMAGE_HEADER_EXTRA?=0x1c
7ee7ba190a98 Ability to fix alignment for images with headers like TRX
ray@terran.dlink.ua
parents: 202
diff changeset
130 .else
7ee7ba190a98 Ability to fix alignment for images with headers like TRX
ray@terran.dlink.ua
parents: 202
diff changeset
131 IMAGE_HEADER_EXTRA?=0
7ee7ba190a98 Ability to fix alignment for images with headers like TRX
ray@terran.dlink.ua
parents: 202
diff changeset
132 .endif
8
853f1379ffd2 build system save point
ray
parents: 4
diff changeset
133
408
ad1633205e26 Try to enable CLANG build.
Aleksandr Rybalko <ray@ddteam.net>
parents: 398
diff changeset
134 .if defined(BUILD_ZROUTER_WITH_CLANG)
ad1633205e26 Try to enable CLANG build.
Aleksandr Rybalko <ray@ddteam.net>
parents: 398
diff changeset
135 CLANG_TC_VARS?= \
ad1633205e26 Try to enable CLANG build.
Aleksandr Rybalko <ray@ddteam.net>
parents: 398
diff changeset
136 WITH_CLANG=yes
ad1633205e26 Try to enable CLANG build.
Aleksandr Rybalko <ray@ddteam.net>
parents: 398
diff changeset
137 CLANG_VARS?= \
ad1633205e26 Try to enable CLANG build.
Aleksandr Rybalko <ray@ddteam.net>
parents: 398
diff changeset
138 WITH_CLANG=yes \
ad1633205e26 Try to enable CLANG build.
Aleksandr Rybalko <ray@ddteam.net>
parents: 398
diff changeset
139 CC=clang \
ad1633205e26 Try to enable CLANG build.
Aleksandr Rybalko <ray@ddteam.net>
parents: 398
diff changeset
140 CXX=clang++ \
ad1633205e26 Try to enable CLANG build.
Aleksandr Rybalko <ray@ddteam.net>
parents: 398
diff changeset
141 CPP=clang-cpp
ad1633205e26 Try to enable CLANG build.
Aleksandr Rybalko <ray@ddteam.net>
parents: 398
diff changeset
142 .else
ad1633205e26 Try to enable CLANG build.
Aleksandr Rybalko <ray@ddteam.net>
parents: 398
diff changeset
143 CLANG_TC_VARS?= \
ad1633205e26 Try to enable CLANG build.
Aleksandr Rybalko <ray@ddteam.net>
parents: 398
diff changeset
144 WITHOUT_CLANG=yes
ad1633205e26 Try to enable CLANG build.
Aleksandr Rybalko <ray@ddteam.net>
parents: 398
diff changeset
145 CLANG_VARS?= \
ad1633205e26 Try to enable CLANG build.
Aleksandr Rybalko <ray@ddteam.net>
parents: 398
diff changeset
146 WITHOUT_CLANG=yes
ad1633205e26 Try to enable CLANG build.
Aleksandr Rybalko <ray@ddteam.net>
parents: 398
diff changeset
147 .endif
ad1633205e26 Try to enable CLANG build.
Aleksandr Rybalko <ray@ddteam.net>
parents: 398
diff changeset
148
201
3b87524c2bed cleanup
ray@terran.dlink.ua
parents: 192
diff changeset
149 build-verify:
3b87524c2bed cleanup
ray@terran.dlink.ua
parents: 192
diff changeset
150 .if !exists(${ZROUTER_ROOT}/boards/${TARGET_VENDOR}/) || !exists(${ZROUTER_ROOT}/boards/${TARGET_VENDOR}/${TARGET_DEVICE}/)
3b87524c2bed cleanup
ray@terran.dlink.ua
parents: 192
diff changeset
151 @echo "Error: No board configuration for pair TARGET_VENDOR/TARGET_DEVICE \`\"${TARGET_VENDOR}\"/\"${TARGET_DEVICE}\"\`"
3b87524c2bed cleanup
ray@terran.dlink.ua
parents: 192
diff changeset
152 @echo "Possible pairs: ${TARGET_PAIRS}"
3b87524c2bed cleanup
ray@terran.dlink.ua
parents: 192
diff changeset
153 @exit 1
11
fd1f3cd8c153 savepoint, kernel config, cleandep, dep - DONE
ray
parents: 9
diff changeset
154 .endif
201
3b87524c2bed cleanup
ray@terran.dlink.ua
parents: 192
diff changeset
155 .if !defined(TARGET) || !defined(TARGET_ARCH) || !defined(TARGET_SOCDIR)
3b87524c2bed cleanup
ray@terran.dlink.ua
parents: 192
diff changeset
156 @echo "Error: No board configuration for pair SOC_VENDOR/SOC_CHIP \`\"${SOC_VENDOR}\"/\"${SOC_CHIP}\"\`"
3b87524c2bed cleanup
ray@terran.dlink.ua
parents: 192
diff changeset
157 @echo "Possible pairs: ${SOC_PAIRS}"
3b87524c2bed cleanup
ray@terran.dlink.ua
parents: 192
diff changeset
158 @exit 1
3b87524c2bed cleanup
ray@terran.dlink.ua
parents: 192
diff changeset
159 .endif
8
853f1379ffd2 build system save point
ray
parents: 4
diff changeset
160
138
ray@terran.dlink.ua
parents: 135
diff changeset
161 build-info:
ray@terran.dlink.ua
parents: 135
diff changeset
162 @echo "++++++++++++++ Selected settings for building ++++++++++++++"
ray@terran.dlink.ua
parents: 135
diff changeset
163 @echo "Device: ${TARGET_DEVICE}"
ray@terran.dlink.ua
parents: 135
diff changeset
164 @echo "Vendor: ${TARGET_VENDOR}"
ray@terran.dlink.ua
parents: 135
diff changeset
165 @echo "SoC Chip: ${SOC_CHIP}"
ray@terran.dlink.ua
parents: 135
diff changeset
166 @echo "SoC Vendor: ${SOC_VENDOR}"
366
462445ce9207 (Clean|Tidy)up, prepare for updated menu.sh
ray@terran.dlink.ua
parents: 353
diff changeset
167 @echo "Enabled Profiles: ${TARGET_PROFILES}"
138
ray@terran.dlink.ua
parents: 135
diff changeset
168 @echo
ray@terran.dlink.ua
parents: 135
diff changeset
169
8
853f1379ffd2 build system save point
ray
parents: 4
diff changeset
170 basic-tools:
11
fd1f3cd8c153 savepoint, kernel config, cleandep, dep - DONE
ray
parents: 9
diff changeset
171 ZROUTER_ROOT=${ZROUTER_ROOT} MAKEOBJDIRPREFIX=${ZROUTER_OBJ}/tmp/ ${MAKE} -f ${ZROUTER_ROOT}/Makefile.tools
8
853f1379ffd2 build system save point
ray
parents: 4
diff changeset
172
853f1379ffd2 build system save point
ray
parents: 4
diff changeset
173 basic-tools-clean:
11
fd1f3cd8c153 savepoint, kernel config, cleandep, dep - DONE
ray
parents: 9
diff changeset
174 ZROUTER_ROOT=${ZROUTER_ROOT} MAKEOBJDIRPREFIX=${ZROUTER_OBJ}/tmp/ ${MAKE} -f ${ZROUTER_ROOT}/Makefile.tools clean
8
853f1379ffd2 build system save point
ray
parents: 4
diff changeset
175
9
c104810019a0 buildenv savepoint kernconf/kern.hints generating
ray@terran.dlink.ua
parents: 8
diff changeset
176 ${KERNELCONFDIR}:
c104810019a0 buildenv savepoint kernconf/kern.hints generating
ray@terran.dlink.ua
parents: 8
diff changeset
177 mkdir -p ${KERNELCONFDIR}
8
853f1379ffd2 build system save point
ray
parents: 4
diff changeset
178
9
c104810019a0 buildenv savepoint kernconf/kern.hints generating
ray@terran.dlink.ua
parents: 8
diff changeset
179
c104810019a0 buildenv savepoint kernconf/kern.hints generating
ray@terran.dlink.ua
parents: 8
diff changeset
180 # Generate kernel config file
c104810019a0 buildenv savepoint kernconf/kern.hints generating
ray@terran.dlink.ua
parents: 8
diff changeset
181 KERNEL_HINTS_FILE?=${KERNELCONFDIR}/${TARGET_VENDOR}_${TARGET_DEVICE}.hints
c104810019a0 buildenv savepoint kernconf/kern.hints generating
ray@terran.dlink.ua
parents: 8
diff changeset
182 KERNEL_CONFIG_FILE?=${KERNELCONFDIR}/${TARGET_VENDOR}_${TARGET_DEVICE}
c104810019a0 buildenv savepoint kernconf/kern.hints generating
ray@terran.dlink.ua
parents: 8
diff changeset
183
c104810019a0 buildenv savepoint kernconf/kern.hints generating
ray@terran.dlink.ua
parents: 8
diff changeset
184 kernelconfig: ${TARGET_SOCDIR}/${SOC_KERNCONF} ${KERNELCONFDIR}
76
f6fba87a95a6 NQ-900 tune
ray@terran.dlink.ua
parents: 75
diff changeset
185 echo "# Kernel config for ${SOC_CHIP} on ${TARGET_VENDOR} ${TARGET_DEVICE} board" > ${KERNEL_CONFIG_FILE}
f6fba87a95a6 NQ-900 tune
ray@terran.dlink.ua
parents: 75
diff changeset
186 echo "machine ${KERNCONF_MACHINE}" >> ${KERNEL_CONFIG_FILE}
f6fba87a95a6 NQ-900 tune
ray@terran.dlink.ua
parents: 75
diff changeset
187 echo "ident ${KERNCONF_IDENT}" >> ${KERNEL_CONFIG_FILE}
192
20320aa1f338 many cpu options support +armeb FS hack
ray@terran.dlink.ua
parents: 185
diff changeset
188 .for cpu in ${KERNCONF_CPU}
20320aa1f338 many cpu options support +armeb FS hack
ray@terran.dlink.ua
parents: 185
diff changeset
189 echo "cpu ${cpu}" >> ${KERNEL_CONFIG_FILE}
20320aa1f338 many cpu options support +armeb FS hack
ray@terran.dlink.ua
parents: 185
diff changeset
190 .endfor
76
f6fba87a95a6 NQ-900 tune
ray@terran.dlink.ua
parents: 75
diff changeset
191 echo "hints \"${KERNEL_HINTS_FILE}\"" >> ${KERNEL_CONFIG_FILE}
f6fba87a95a6 NQ-900 tune
ray@terran.dlink.ua
parents: 75
diff changeset
192 echo "# makeoptions section" >> ${KERNEL_CONFIG_FILE}
87
96b52a080f89 NQ-901 begin
ray@terran.dlink.ua
parents: 86
diff changeset
193 if [ "x${KERNCONF_MODULES_OVERRIDE}" = "xnone" ] ; then \
96b52a080f89 NQ-901 begin
ray@terran.dlink.ua
parents: 86
diff changeset
194 echo "makeoptions MODULES_OVERRIDE=\"\"" >> ${KERNEL_CONFIG_FILE} ; \
96b52a080f89 NQ-901 begin
ray@terran.dlink.ua
parents: 86
diff changeset
195 else \
96b52a080f89 NQ-901 begin
ray@terran.dlink.ua
parents: 86
diff changeset
196 if [ "x${KERNCONF_MODULES_OVERRIDE}" != "x" ] ; then \
96b52a080f89 NQ-901 begin
ray@terran.dlink.ua
parents: 86
diff changeset
197 echo "makeoptions MODULES_OVERRIDE=\"${KERNCONF_MODULES_OVERRIDE}\"" >> ${KERNEL_CONFIG_FILE} ; \
96b52a080f89 NQ-901 begin
ray@terran.dlink.ua
parents: 86
diff changeset
198 fi ; \
96b52a080f89 NQ-901 begin
ray@terran.dlink.ua
parents: 86
diff changeset
199 fi
11
fd1f3cd8c153 savepoint, kernel config, cleandep, dep - DONE
ray
parents: 9
diff changeset
200 .for makeoption in ${KERNCONF_MAKEOPTIONS}
76
f6fba87a95a6 NQ-900 tune
ray@terran.dlink.ua
parents: 75
diff changeset
201 echo "makeoptions ${makeoption}" >> ${KERNEL_CONFIG_FILE}
11
fd1f3cd8c153 savepoint, kernel config, cleandep, dep - DONE
ray
parents: 9
diff changeset
202 .endfor
76
f6fba87a95a6 NQ-900 tune
ray@terran.dlink.ua
parents: 75
diff changeset
203 echo "# files section" >> ${KERNEL_CONFIG_FILE}
9
c104810019a0 buildenv savepoint kernconf/kern.hints generating
ray@terran.dlink.ua
parents: 8
diff changeset
204 .for file in ${KERNCONF_FILES}
76
f6fba87a95a6 NQ-900 tune
ray@terran.dlink.ua
parents: 75
diff changeset
205 echo "files \"${file}\"" >> ${KERNEL_CONFIG_FILE}
9
c104810019a0 buildenv savepoint kernconf/kern.hints generating
ray@terran.dlink.ua
parents: 8
diff changeset
206 .endfor
76
f6fba87a95a6 NQ-900 tune
ray@terran.dlink.ua
parents: 75
diff changeset
207 echo "# options section" >> ${KERNEL_CONFIG_FILE}
9
c104810019a0 buildenv savepoint kernconf/kern.hints generating
ray@terran.dlink.ua
parents: 8
diff changeset
208 .for option in ${KERNCONF_OPTIONS}
76
f6fba87a95a6 NQ-900 tune
ray@terran.dlink.ua
parents: 75
diff changeset
209 echo "options ${option}" >> ${KERNEL_CONFIG_FILE}
9
c104810019a0 buildenv savepoint kernconf/kern.hints generating
ray@terran.dlink.ua
parents: 8
diff changeset
210 .endfor
76
f6fba87a95a6 NQ-900 tune
ray@terran.dlink.ua
parents: 75
diff changeset
211 echo "# devices section" >> ${KERNEL_CONFIG_FILE}
9
c104810019a0 buildenv savepoint kernconf/kern.hints generating
ray@terran.dlink.ua
parents: 8
diff changeset
212 .for device in ${KERNCONF_DEVICES}
76
f6fba87a95a6 NQ-900 tune
ray@terran.dlink.ua
parents: 75
diff changeset
213 echo "device ${device}" >> ${KERNEL_CONFIG_FILE}
9
c104810019a0 buildenv savepoint kernconf/kern.hints generating
ray@terran.dlink.ua
parents: 8
diff changeset
214 .endfor
87
96b52a080f89 NQ-901 begin
ray@terran.dlink.ua
parents: 86
diff changeset
215 .for nodevice in ${KERNCONF_NODEVICES}
96b52a080f89 NQ-901 begin
ray@terran.dlink.ua
parents: 86
diff changeset
216 echo "nodevice ${nodevice}" >> ${KERNEL_CONFIG_FILE}
96b52a080f89 NQ-901 begin
ray@terran.dlink.ua
parents: 86
diff changeset
217 .endfor
8
853f1379ffd2 build system save point
ray
parents: 4
diff changeset
218
9
c104810019a0 buildenv savepoint kernconf/kern.hints generating
ray@terran.dlink.ua
parents: 8
diff changeset
219 # Generate .hints file
c104810019a0 buildenv savepoint kernconf/kern.hints generating
ray@terran.dlink.ua
parents: 8
diff changeset
220 # TODO: generate hints on MAP partiotion list, GPIO usege list
c104810019a0 buildenv savepoint kernconf/kern.hints generating
ray@terran.dlink.ua
parents: 8
diff changeset
221 .if exists(${TARGET_SOCDIR}/soc.hints)
c104810019a0 buildenv savepoint kernconf/kern.hints generating
ray@terran.dlink.ua
parents: 8
diff changeset
222 _SOC_HINTS=${TARGET_SOCDIR}/soc.hints
c104810019a0 buildenv savepoint kernconf/kern.hints generating
ray@terran.dlink.ua
parents: 8
diff changeset
223 .endif
11
fd1f3cd8c153 savepoint, kernel config, cleandep, dep - DONE
ray
parents: 9
diff changeset
224 .if exists(${TARGET_BOARDDIR}/board.hints)
fd1f3cd8c153 savepoint, kernel config, cleandep, dep - DONE
ray
parents: 9
diff changeset
225 _DEVICE_HINTS=${TARGET_BOARDDIR}/board.hints
9
c104810019a0 buildenv savepoint kernconf/kern.hints generating
ray@terran.dlink.ua
parents: 8
diff changeset
226 .endif
8
853f1379ffd2 build system save point
ray
parents: 4
diff changeset
227
9
c104810019a0 buildenv savepoint kernconf/kern.hints generating
ray@terran.dlink.ua
parents: 8
diff changeset
228 kernelhints: ${_SOC_HINTS} ${_DEVICE_HINTS} ${KERNELCONFDIR}
11
fd1f3cd8c153 savepoint, kernel config, cleandep, dep - DONE
ray
parents: 9
diff changeset
229 cat /dev/null ${_SOC_HINTS} ${_DEVICE_HINTS} > ${KERNEL_HINTS_FILE}
9
c104810019a0 buildenv savepoint kernconf/kern.hints generating
ray@terran.dlink.ua
parents: 8
diff changeset
230
15
73b96233b7e3 kernel build/install done, and cleaned
ray@terran.dlink.ua
parents: 14
diff changeset
231 # TODO: make dtd file for FDT
18
85044067aadb profiles started
ray@terran.dlink.ua
parents: 17
diff changeset
232 #
12
7e92f3a87e8f kernel+modules builded
ray@terran.dlink.ua
parents: 11
diff changeset
233
408
ad1633205e26 Try to enable CLANG build.
Aleksandr Rybalko <ray@ddteam.net>
parents: 398
diff changeset
234 _KERNEL_TC_BUILD_ENV= \
ad1633205e26 Try to enable CLANG build.
Aleksandr Rybalko <ray@ddteam.net>
parents: 398
diff changeset
235 TARGET=${TARGET} \
ad1633205e26 Try to enable CLANG build.
Aleksandr Rybalko <ray@ddteam.net>
parents: 398
diff changeset
236 TARGET_ARCH=${TARGET_ARCH} \
ad1633205e26 Try to enable CLANG build.
Aleksandr Rybalko <ray@ddteam.net>
parents: 398
diff changeset
237 TARGET_CPUARCH=${TARGET_CPUARCH} \
ad1633205e26 Try to enable CLANG build.
Aleksandr Rybalko <ray@ddteam.net>
parents: 398
diff changeset
238 ZROUTER_ROOT=${ZROUTER_ROOT} \
ad1633205e26 Try to enable CLANG build.
Aleksandr Rybalko <ray@ddteam.net>
parents: 398
diff changeset
239 WITHOUT_RESCUE=yes \
ad1633205e26 Try to enable CLANG build.
Aleksandr Rybalko <ray@ddteam.net>
parents: 398
diff changeset
240 ${CLANG_TC_VARS} \
ad1633205e26 Try to enable CLANG build.
Aleksandr Rybalko <ray@ddteam.net>
parents: 398
diff changeset
241 -DNO_CLEAN
ad1633205e26 Try to enable CLANG build.
Aleksandr Rybalko <ray@ddteam.net>
parents: 398
diff changeset
242
12
7e92f3a87e8f kernel+modules builded
ray@terran.dlink.ua
parents: 11
diff changeset
243 _KERNEL_BUILD_ENV= \
7e92f3a87e8f kernel+modules builded
ray@terran.dlink.ua
parents: 11
diff changeset
244 TARGET=${TARGET} \
7e92f3a87e8f kernel+modules builded
ray@terran.dlink.ua
parents: 11
diff changeset
245 TARGET_ARCH=${TARGET_ARCH} \
202
02c1a507ea30 Allow to specify TARGET_CPUARCH in soc.mk or board.mk
ray@terran.dlink.ua
parents: 201
diff changeset
246 TARGET_CPUARCH=${TARGET_CPUARCH} \
15
73b96233b7e3 kernel build/install done, and cleaned
ray@terran.dlink.ua
parents: 14
diff changeset
247 ZROUTER_ROOT=${ZROUTER_ROOT} \
92
1f35a72196e6 lot of fixes
ray@terran.dlink.ua
parents: 91
diff changeset
248 WITHOUT_RESCUE=yes \
408
ad1633205e26 Try to enable CLANG build.
Aleksandr Rybalko <ray@ddteam.net>
parents: 398
diff changeset
249 ${CLANG_VARS} \
15
73b96233b7e3 kernel build/install done, and cleaned
ray@terran.dlink.ua
parents: 14
diff changeset
250 -DNO_CLEAN
73b96233b7e3 kernel build/install done, and cleaned
ray@terran.dlink.ua
parents: 14
diff changeset
251
14
e463b6c66d53 kernel builded, searching for problems
ray@terran.dlink.ua
parents: 13
diff changeset
252
15
73b96233b7e3 kernel build/install done, and cleaned
ray@terran.dlink.ua
parents: 14
diff changeset
253 kernel-toolchain:
415
c2163079c392 Allow to skip kernel toolchain build.
Aleksandr Rybalko <ray@ddteam.net>
parents: 414
diff changeset
254 .if !defined(SKIP_TOOLCHAIN)
408
ad1633205e26 Try to enable CLANG build.
Aleksandr Rybalko <ray@ddteam.net>
parents: 398
diff changeset
255 MAKEOBJDIRPREFIX=${ZROUTER_OBJ}/tmp/ ${MAKE} ${_KERNEL_TC_BUILD_ENV} -C ${FREEBSD_SRC_TREE} kernel-toolchain
415
c2163079c392 Allow to skip kernel toolchain build.
Aleksandr Rybalko <ray@ddteam.net>
parents: 414
diff changeset
256 .endif
12
7e92f3a87e8f kernel+modules builded
ray@terran.dlink.ua
parents: 11
diff changeset
257
321
4445eeeff278 Tidy up main Makefile. make lines shortest.
ray@terran.dlink.ua
parents: 315
diff changeset
258 ${ZROUTER_FREEBSD_OBJDIR}/tmp/usr/bin/cc: kernel-toolchain
91
fef55b0f6b99 many parts
ray@terran.dlink.ua
parents: 90
diff changeset
259
321
4445eeeff278 Tidy up main Makefile. make lines shortest.
ray@terran.dlink.ua
parents: 315
diff changeset
260 kernel-build: kernelconfig kernelhints ${ZROUTER_FREEBSD_OBJDIR}/tmp/usr/bin/cc
392
67a61a0c4cdb * Add SKIP_WORLD_INSTALL to not touch world stages (fast kernel rebuild)
Aleksandr Rybalko <ray@ddteam.net>
parents: 372
diff changeset
261 .if defined(WITH_KERNFAST)
67a61a0c4cdb * Add SKIP_WORLD_INSTALL to not touch world stages (fast kernel rebuild)
Aleksandr Rybalko <ray@ddteam.net>
parents: 372
diff changeset
262 MAKEOBJDIRPREFIX=${ZROUTER_OBJ}/tmp/ ${MAKE} ${_KERNEL_BUILD_ENV} -C ${FREEBSD_SRC_TREE} KERNFAST=${KERNEL_CONFIG_FILE} buildkernel
67a61a0c4cdb * Add SKIP_WORLD_INSTALL to not touch world stages (fast kernel rebuild)
Aleksandr Rybalko <ray@ddteam.net>
parents: 372
diff changeset
263 .else
14
e463b6c66d53 kernel builded, searching for problems
ray@terran.dlink.ua
parents: 13
diff changeset
264 MAKEOBJDIRPREFIX=${ZROUTER_OBJ}/tmp/ ${MAKE} ${_KERNEL_BUILD_ENV} -C ${FREEBSD_SRC_TREE} KERNCONF=${KERNEL_CONFIG_FILE} buildkernel
392
67a61a0c4cdb * Add SKIP_WORLD_INSTALL to not touch world stages (fast kernel rebuild)
Aleksandr Rybalko <ray@ddteam.net>
parents: 372
diff changeset
265 .endif
13
d8bb9c177242 savepoint kernel build rework
ray
parents: 12
diff changeset
266
15
73b96233b7e3 kernel build/install done, and cleaned
ray@terran.dlink.ua
parents: 14
diff changeset
267 #XXX_BEGIN Only for testing
73b96233b7e3 kernel build/install done, and cleaned
ray@terran.dlink.ua
parents: 14
diff changeset
268 KMODOWN!=id -u -n
73b96233b7e3 kernel build/install done, and cleaned
ray@terran.dlink.ua
parents: 14
diff changeset
269 KMODGRP!=id -g -n
90
89de91c025a5 +mpd +shttpd +dlink_web
ray@terran.dlink.ua
parents: 89
diff changeset
270 _KERNEL_BUILD_ENV+=KMODOWN=${KMODOWN}
89de91c025a5 +mpd +shttpd +dlink_web
ray@terran.dlink.ua
parents: 89
diff changeset
271 _KERNEL_BUILD_ENV+=KMODGRP=${KMODGRP}
15
73b96233b7e3 kernel build/install done, and cleaned
ray@terran.dlink.ua
parents: 14
diff changeset
272 #XXX_END Only for testing
8
853f1379ffd2 build system save point
ray
parents: 4
diff changeset
273
201
3b87524c2bed cleanup
ray@terran.dlink.ua
parents: 192
diff changeset
274 kernel: build-verify build-info kernel-toolchain kernel-build kernel-install-dir kernel-install
3b87524c2bed cleanup
ray@terran.dlink.ua
parents: 192
diff changeset
275 .ORDER: build-verify build-info kernel-toolchain kernel-build kernel-install-dir kernel-install
11
fd1f3cd8c153 savepoint, kernel config, cleandep, dep - DONE
ray
parents: 9
diff changeset
276
92
1f35a72196e6 lot of fixes
ray@terran.dlink.ua
parents: 91
diff changeset
277 _WORLD_TCBUILD_ENV= \
1f35a72196e6 lot of fixes
ray@terran.dlink.ua
parents: 91
diff changeset
278 TARGET=${TARGET} \
1f35a72196e6 lot of fixes
ray@terran.dlink.ua
parents: 91
diff changeset
279 TARGET_ARCH=${TARGET_ARCH} \
202
02c1a507ea30 Allow to specify TARGET_CPUARCH in soc.mk or board.mk
ray@terran.dlink.ua
parents: 201
diff changeset
280 TARGET_CPUARCH=${TARGET_CPUARCH} \
92
1f35a72196e6 lot of fixes
ray@terran.dlink.ua
parents: 91
diff changeset
281 ZROUTER_ROOT=${ZROUTER_ROOT} \
1f35a72196e6 lot of fixes
ray@terran.dlink.ua
parents: 91
diff changeset
282 WITHOUT_ATM=yes \
305
c230dd90b13a add WITHOUT_ATM=yes option
ray@terran.dlink.ua
parents: 304
diff changeset
283 WITHOUT_AUDIT=yes \
92
1f35a72196e6 lot of fixes
ray@terran.dlink.ua
parents: 91
diff changeset
284 WITHOUT_INFO=yes \
1f35a72196e6 lot of fixes
ray@terran.dlink.ua
parents: 91
diff changeset
285 WITHOUT_IPX=yes \
1f35a72196e6 lot of fixes
ray@terran.dlink.ua
parents: 91
diff changeset
286 WITHOUT_LOCALES=yes \
1f35a72196e6 lot of fixes
ray@terran.dlink.ua
parents: 91
diff changeset
287 WITHOUT_MAN=yes \
1f35a72196e6 lot of fixes
ray@terran.dlink.ua
parents: 91
diff changeset
288 WITHOUT_NLS=yes \
1f35a72196e6 lot of fixes
ray@terran.dlink.ua
parents: 91
diff changeset
289 WITHOUT_PROFILE=yes \
1f35a72196e6 lot of fixes
ray@terran.dlink.ua
parents: 91
diff changeset
290 WITHOUT_RESCUE=yes \
1f35a72196e6 lot of fixes
ray@terran.dlink.ua
parents: 91
diff changeset
291 WITHOUT_CDDL=yes \
408
ad1633205e26 Try to enable CLANG build.
Aleksandr Rybalko <ray@ddteam.net>
parents: 398
diff changeset
292 ${CLANG_TC_VARS} \
92
1f35a72196e6 lot of fixes
ray@terran.dlink.ua
parents: 91
diff changeset
293 WITHOUT_CRYPTO=yes \
1f35a72196e6 lot of fixes
ray@terran.dlink.ua
parents: 91
diff changeset
294 WITHOUT_NIS=yes \
1f35a72196e6 lot of fixes
ray@terran.dlink.ua
parents: 91
diff changeset
295 WITHOUT_KERBEROS=yes \
408
ad1633205e26 Try to enable CLANG build.
Aleksandr Rybalko <ray@ddteam.net>
parents: 398
diff changeset
296 MALLOC_PRODUCTION=yes \
92
1f35a72196e6 lot of fixes
ray@terran.dlink.ua
parents: 91
diff changeset
297 -DNO_CLEAN
1f35a72196e6 lot of fixes
ray@terran.dlink.ua
parents: 91
diff changeset
298
16
1091c99a69ff savepoint: world started
ray
parents: 15
diff changeset
299 _WORLD_BUILD_ENV= \
1091c99a69ff savepoint: world started
ray
parents: 15
diff changeset
300 TARGET=${TARGET} \
1091c99a69ff savepoint: world started
ray
parents: 15
diff changeset
301 TARGET_ARCH=${TARGET_ARCH} \
202
02c1a507ea30 Allow to specify TARGET_CPUARCH in soc.mk or board.mk
ray@terran.dlink.ua
parents: 201
diff changeset
302 TARGET_CPUARCH=${TARGET_CPUARCH} \
16
1091c99a69ff savepoint: world started
ray
parents: 15
diff changeset
303 ZROUTER_ROOT=${ZROUTER_ROOT} \
92
1f35a72196e6 lot of fixes
ray@terran.dlink.ua
parents: 91
diff changeset
304 WITHOUT_ASSERT_DEBUG=yes \
1f35a72196e6 lot of fixes
ray@terran.dlink.ua
parents: 91
diff changeset
305 WITHOUT_ATM=yes \
305
c230dd90b13a add WITHOUT_ATM=yes option
ray@terran.dlink.ua
parents: 304
diff changeset
306 WITHOUT_AUDIT=yes \
408
ad1633205e26 Try to enable CLANG build.
Aleksandr Rybalko <ray@ddteam.net>
parents: 398
diff changeset
307 ${CLANG_VARS} \
18
85044067aadb profiles started
ray@terran.dlink.ua
parents: 17
diff changeset
308 WITHOUT_INFO=yes \
92
1f35a72196e6 lot of fixes
ray@terran.dlink.ua
parents: 91
diff changeset
309 WITHOUT_INSTALLLIB=yes \
1f35a72196e6 lot of fixes
ray@terran.dlink.ua
parents: 91
diff changeset
310 WITHOUT_IPX=yes \
18
85044067aadb profiles started
ray@terran.dlink.ua
parents: 17
diff changeset
311 WITHOUT_LOCALES=yes \
85044067aadb profiles started
ray@terran.dlink.ua
parents: 17
diff changeset
312 WITHOUT_MAN=yes \
85044067aadb profiles started
ray@terran.dlink.ua
parents: 17
diff changeset
313 WITHOUT_NLS=yes \
85044067aadb profiles started
ray@terran.dlink.ua
parents: 17
diff changeset
314 WITHOUT_PROFILE=yes \
85044067aadb profiles started
ray@terran.dlink.ua
parents: 17
diff changeset
315 WITHOUT_RESCUE=yes \
92
1f35a72196e6 lot of fixes
ray@terran.dlink.ua
parents: 91
diff changeset
316 WITHOUT_SSP=yes \
408
ad1633205e26 Try to enable CLANG build.
Aleksandr Rybalko <ray@ddteam.net>
parents: 398
diff changeset
317 MALLOC_PRODUCTION=yes \
16
1091c99a69ff savepoint: world started
ray
parents: 15
diff changeset
318 -DNO_CLEAN
1091c99a69ff savepoint: world started
ray
parents: 15
diff changeset
319
92
1f35a72196e6 lot of fixes
ray@terran.dlink.ua
parents: 91
diff changeset
320
1f35a72196e6 lot of fixes
ray@terran.dlink.ua
parents: 91
diff changeset
321 .if !defined(JAIL_ENABLE)
1f35a72196e6 lot of fixes
ray@terran.dlink.ua
parents: 91
diff changeset
322 _WORLD_BUILD_ENV+= WITHOUT_JAIL=yes
1f35a72196e6 lot of fixes
ray@terran.dlink.ua
parents: 91
diff changeset
323 .endif
1f35a72196e6 lot of fixes
ray@terran.dlink.ua
parents: 91
diff changeset
324 .if !defined(IPV6_ENABLE)
1f35a72196e6 lot of fixes
ray@terran.dlink.ua
parents: 91
diff changeset
325 _WORLD_BUILD_ENV+= WITHOUT_INET6=yes WITHOUT_INET6_SUPPORT=yes
1f35a72196e6 lot of fixes
ray@terran.dlink.ua
parents: 91
diff changeset
326 .endif
17
6f4762ee242a savepoint: world
ray
parents: 16
diff changeset
327 .if !defined(INSTALL_MAN)
18
85044067aadb profiles started
ray@terran.dlink.ua
parents: 17
diff changeset
328 _WORLD_BUILD_ENV+= WITHOUT_MAN=yes
17
6f4762ee242a savepoint: world
ray
parents: 16
diff changeset
329 .endif
6f4762ee242a savepoint: world
ray
parents: 16
diff changeset
330 .if !defined(INSTALL_INFO)
18
85044067aadb profiles started
ray@terran.dlink.ua
parents: 17
diff changeset
331 _WORLD_BUILD_ENV+= WITHOUT_INFO=yes
17
6f4762ee242a savepoint: world
ray
parents: 16
diff changeset
332 .endif
6f4762ee242a savepoint: world
ray
parents: 16
diff changeset
333 .if !defined(INSTALL_NLS)
18
85044067aadb profiles started
ray@terran.dlink.ua
parents: 17
diff changeset
334 _WORLD_BUILD_ENV+= WITHOUT_NLS=yes
17
6f4762ee242a savepoint: world
ray
parents: 16
diff changeset
335 .endif
18
85044067aadb profiles started
ray@terran.dlink.ua
parents: 17
diff changeset
336
201
3b87524c2bed cleanup
ray@terran.dlink.ua
parents: 192
diff changeset
337 .if !defined(INSTALL_TOOLCHAIN)
90
89de91c025a5 +mpd +shttpd +dlink_web
ray@terran.dlink.ua
parents: 89
diff changeset
338 _WORLD_INSTALL_ENV+=NO_STATIC_LIB=yes
89de91c025a5 +mpd +shttpd +dlink_web
ray@terran.dlink.ua
parents: 89
diff changeset
339 _WORLD_INSTALL_ENV+=WITHOUT_TOOLCHAIN=yes
201
3b87524c2bed cleanup
ray@terran.dlink.ua
parents: 192
diff changeset
340 .endif
18
85044067aadb profiles started
ray@terran.dlink.ua
parents: 17
diff changeset
341
222
7ee7ba190a98 Ability to fix alignment for images with headers like TRX
ray@terran.dlink.ua
parents: 202
diff changeset
342 .if !defined(WITH_IPSEC)
7ee7ba190a98 Ability to fix alignment for images with headers like TRX
ray@terran.dlink.ua
parents: 202
diff changeset
343 _WORLD_BUILD_ENV+=WITHOUT_IPSEC=yes
7ee7ba190a98 Ability to fix alignment for images with headers like TRX
ray@terran.dlink.ua
parents: 202
diff changeset
344 _WORLD_INSTALL_ENV+=WITHOUT_IPSEC=yes
7ee7ba190a98 Ability to fix alignment for images with headers like TRX
ray@terran.dlink.ua
parents: 202
diff changeset
345 .endif
7ee7ba190a98 Ability to fix alignment for images with headers like TRX
ray@terran.dlink.ua
parents: 202
diff changeset
346
90
89de91c025a5 +mpd +shttpd +dlink_web
ray@terran.dlink.ua
parents: 89
diff changeset
347 _WORLD_BUILD_ENV+=WITHOUT_CDDL=yes
89de91c025a5 +mpd +shttpd +dlink_web
ray@terran.dlink.ua
parents: 89
diff changeset
348
89de91c025a5 +mpd +shttpd +dlink_web
ray@terran.dlink.ua
parents: 89
diff changeset
349 _WORLD_BUILD_ENV+=WITHOUT_NIS=yes
86
95d3b08a9da4 buildworld update and tune
ray
parents: 85
diff changeset
350
90
89de91c025a5 +mpd +shttpd +dlink_web
ray@terran.dlink.ua
parents: 89
diff changeset
351 _WORLD_BUILD_ENV+=WITHOUT_BLUETOOTH=yes
86
95d3b08a9da4 buildworld update and tune
ray
parents: 85
diff changeset
352
223
40ec232a5205 fix WITH_WIDEC break
ray@terran.dlink.ua
parents: 222
diff changeset
353 .if defined(WITH_WIDEC) && ${WITH_WIDEC} == "yes"
90
89de91c025a5 +mpd +shttpd +dlink_web
ray@terran.dlink.ua
parents: 89
diff changeset
354 _WORLD_BUILD_ENV+=NOENABLE_WIDEC=yes -DNOENABLE_WIDEC
222
7ee7ba190a98 Ability to fix alignment for images with headers like TRX
ray@terran.dlink.ua
parents: 202
diff changeset
355 .endif
87
96b52a080f89 NQ-901 begin
ray@terran.dlink.ua
parents: 86
diff changeset
356
90
89de91c025a5 +mpd +shttpd +dlink_web
ray@terran.dlink.ua
parents: 89
diff changeset
357 _WORLD_BUILD_ENV+=WITHOUT_KERBEROS=yes
89de91c025a5 +mpd +shttpd +dlink_web
ray@terran.dlink.ua
parents: 89
diff changeset
358 _WORLD_BUILD_ENV+=WITHOUT_KERBEROS_SUPPORT=yes
310
0c314d339445 Fix new grep links.
ray@terran.dlink.ua
parents: 307
diff changeset
359 _WORLD_BUILD_ENV+=${WORLD_BUILD_ENV_EXTRA}
17
6f4762ee242a savepoint: world
ray
parents: 16
diff changeset
360
6f4762ee242a savepoint: world
ray
parents: 16
diff changeset
361
6f4762ee242a savepoint: world
ray
parents: 16
diff changeset
362 #XXX_BEGIN Only for testing
6f4762ee242a savepoint: world
ray
parents: 16
diff changeset
363 OWN!=id -u -n
6f4762ee242a savepoint: world
ray
parents: 16
diff changeset
364 GRP!=id -g -n
90
89de91c025a5 +mpd +shttpd +dlink_web
ray@terran.dlink.ua
parents: 89
diff changeset
365 _WORLD_INSTALL_ENV+=BINOWN=${OWN}
89de91c025a5 +mpd +shttpd +dlink_web
ray@terran.dlink.ua
parents: 89
diff changeset
366 _WORLD_INSTALL_ENV+=BINGRP=${GRP}
89de91c025a5 +mpd +shttpd +dlink_web
ray@terran.dlink.ua
parents: 89
diff changeset
367 _WORLD_INSTALL_ENV+=LIBOWN=${OWN}
89de91c025a5 +mpd +shttpd +dlink_web
ray@terran.dlink.ua
parents: 89
diff changeset
368 _WORLD_INSTALL_ENV+=LIBGRP=${GRP}
89de91c025a5 +mpd +shttpd +dlink_web
ray@terran.dlink.ua
parents: 89
diff changeset
369 _WORLD_INSTALL_ENV+=MANOWN=${OWN}
89de91c025a5 +mpd +shttpd +dlink_web
ray@terran.dlink.ua
parents: 89
diff changeset
370 _WORLD_INSTALL_ENV+=MANGRP=${GRP}
91
fef55b0f6b99 many parts
ray@terran.dlink.ua
parents: 90
diff changeset
371 _WORLD_INSTALL_ENV+=INSTALL="sh ${ZROUTER_ROOT}/tools/install.sh"
17
6f4762ee242a savepoint: world
ray
parents: 16
diff changeset
372 #XXX_END Only for testing
6f4762ee242a savepoint: world
ray
parents: 16
diff changeset
373
86
95d3b08a9da4 buildworld update and tune
ray
parents: 85
diff changeset
374 WORLD_SUBDIRS+=include
95d3b08a9da4 buildworld update and tune
ray
parents: 85
diff changeset
375
185
752079a08427 tidy up
ray@terran.dlink.ua
parents: 177
diff changeset
376 .for lib in ${WORLD_SUBDIRS_LIB}
752079a08427 tidy up
ray@terran.dlink.ua
parents: 177
diff changeset
377 WORLD_SUBDIRS+=lib/${lib}
752079a08427 tidy up
ray@terran.dlink.ua
parents: 177
diff changeset
378 .endfor
752079a08427 tidy up
ray@terran.dlink.ua
parents: 177
diff changeset
379
18
85044067aadb profiles started
ray@terran.dlink.ua
parents: 17
diff changeset
380 .for dir in ${WORLD_SUBDIRS_BIN}
85044067aadb profiles started
ray@terran.dlink.ua
parents: 17
diff changeset
381 WORLD_SUBDIRS+=bin/${dir}
85044067aadb profiles started
ray@terran.dlink.ua
parents: 17
diff changeset
382 .endfor
85044067aadb profiles started
ray@terran.dlink.ua
parents: 17
diff changeset
383
85044067aadb profiles started
ray@terran.dlink.ua
parents: 17
diff changeset
384 .for dir in ${WORLD_SUBDIRS_SBIN}
85044067aadb profiles started
ray@terran.dlink.ua
parents: 17
diff changeset
385 WORLD_SUBDIRS+=sbin/${dir}
85044067aadb profiles started
ray@terran.dlink.ua
parents: 17
diff changeset
386 .endfor
85044067aadb profiles started
ray@terran.dlink.ua
parents: 17
diff changeset
387
68
319b8e8bd547 image preparation rules
ray
parents: 47
diff changeset
388 .for dir in ${WORLD_SUBDIRS_USR_BIN}
18
85044067aadb profiles started
ray@terran.dlink.ua
parents: 17
diff changeset
389 WORLD_SUBDIRS+=usr.bin/${dir}
85044067aadb profiles started
ray@terran.dlink.ua
parents: 17
diff changeset
390 .endfor
85044067aadb profiles started
ray@terran.dlink.ua
parents: 17
diff changeset
391
68
319b8e8bd547 image preparation rules
ray
parents: 47
diff changeset
392 .for dir in ${WORLD_SUBDIRS_USR_SBIN}
18
85044067aadb profiles started
ray@terran.dlink.ua
parents: 17
diff changeset
393 WORLD_SUBDIRS+=usr.sbin/${dir}
85044067aadb profiles started
ray@terran.dlink.ua
parents: 17
diff changeset
394 .endfor
85044067aadb profiles started
ray@terran.dlink.ua
parents: 17
diff changeset
395
68
319b8e8bd547 image preparation rules
ray
parents: 47
diff changeset
396 .for dir in ${WORLD_SUBDIRS_LIBEXEC}
319b8e8bd547 image preparation rules
ray
parents: 47
diff changeset
397 WORLD_SUBDIRS+=libexec/${dir}
319b8e8bd547 image preparation rules
ray
parents: 47
diff changeset
398 .endfor
319b8e8bd547 image preparation rules
ray
parents: 47
diff changeset
399
319b8e8bd547 image preparation rules
ray
parents: 47
diff changeset
400 .for dir in ${WORLD_SUBDIRS_GNU_LIB}
319b8e8bd547 image preparation rules
ray
parents: 47
diff changeset
401 WORLD_SUBDIRS+=gnu/lib/${dir}
319b8e8bd547 image preparation rules
ray
parents: 47
diff changeset
402 .endfor
319b8e8bd547 image preparation rules
ray
parents: 47
diff changeset
403
319b8e8bd547 image preparation rules
ray
parents: 47
diff changeset
404 .for dir in ${WORLD_SUBDIRS_GNU_USR_BIN}
319b8e8bd547 image preparation rules
ray
parents: 47
diff changeset
405 WORLD_SUBDIRS+=gnu/usr.bin/${dir}
319b8e8bd547 image preparation rules
ray
parents: 47
diff changeset
406 .endfor
319b8e8bd547 image preparation rules
ray
parents: 47
diff changeset
407
319b8e8bd547 image preparation rules
ray
parents: 47
diff changeset
408
19
b0ce362d3832 tuning profiles, docs
ray
parents: 18
diff changeset
409 # Project local tools
b0ce362d3832 tuning profiles, docs
ray
parents: 18
diff changeset
410 .for dir in ${WORLD_SUBDIRS_ZROUTER}
b0ce362d3832 tuning profiles, docs
ray
parents: 18
diff changeset
411 # Prepend reverse path, then buildworld can go out of source tree
b0ce362d3832 tuning profiles, docs
ray
parents: 18
diff changeset
412 WORLD_SUBDIRS+=${SRCROOTUP}/${ZROUTER_ROOT}/${dir}
b0ce362d3832 tuning profiles, docs
ray
parents: 18
diff changeset
413 .endfor
b0ce362d3832 tuning profiles, docs
ray
parents: 18
diff changeset
414
321
4445eeeff278 Tidy up main Makefile. make lines shortest.
ray@terran.dlink.ua
parents: 315
diff changeset
415 FREEBSD_BUILD_ENV_VARS!=(MAKEOBJDIRPREFIX=${ZROUTER_OBJ}/tmp/ ${MAKE} \
4445eeeff278 Tidy up main Makefile. make lines shortest.
ray@terran.dlink.ua
parents: 315
diff changeset
416 ${_WORLD_BUILD_ENV} -C ${FREEBSD_SRC_TREE} buildenvvars)
70
bfed845746cc image creating, add old lzma
ray
parents: 68
diff changeset
417 # Import buildenvvars into our namespace with suffix FREEBSD_BUILD_ENV_
87
96b52a080f89 NQ-901 begin
ray@terran.dlink.ua
parents: 86
diff changeset
418 .for var in ${FREEBSD_BUILD_ENV_VARS}
70
bfed845746cc image creating, add old lzma
ray
parents: 68
diff changeset
419 FREEBSD_BUILD_ENV_${var}
bfed845746cc image creating, add old lzma
ray
parents: 68
diff changeset
420 .endfor
bfed845746cc image creating, add old lzma
ray
parents: 68
diff changeset
421
177
b468382c0a08 fix ability to do non-cross builds
ray@terran.dlink.ua
parents: 171
diff changeset
422
b468382c0a08 fix ability to do non-cross builds
ray@terran.dlink.ua
parents: 171
diff changeset
423
81
ray
parents:
diff changeset
424 #
ray
parents:
diff changeset
425 # World
ray
parents:
diff changeset
426 #
16
1091c99a69ff savepoint: world started
ray
parents: 15
diff changeset
427 world-toolchain:
392
67a61a0c4cdb * Add SKIP_WORLD_INSTALL to not touch world stages (fast kernel rebuild)
Aleksandr Rybalko <ray@ddteam.net>
parents: 372
diff changeset
428 .if !defined(SKIP_WORLD_INSTALL)
321
4445eeeff278 Tidy up main Makefile. make lines shortest.
ray@terran.dlink.ua
parents: 315
diff changeset
429 MAKEOBJDIRPREFIX=${ZROUTER_OBJ}/tmp/ ${MAKE} ${_WORLD_TCBUILD_ENV} \
4445eeeff278 Tidy up main Makefile. make lines shortest.
ray@terran.dlink.ua
parents: 315
diff changeset
430 -C ${FREEBSD_SRC_TREE} toolchain
392
67a61a0c4cdb * Add SKIP_WORLD_INSTALL to not touch world stages (fast kernel rebuild)
Aleksandr Rybalko <ray@ddteam.net>
parents: 372
diff changeset
431 .endif
16
1091c99a69ff savepoint: world started
ray
parents: 15
diff changeset
432
321
4445eeeff278 Tidy up main Makefile. make lines shortest.
ray@terran.dlink.ua
parents: 315
diff changeset
433 world-build: ${ZROUTER_FREEBSD_OBJDIR}/tmp/usr/bin/cc
392
67a61a0c4cdb * Add SKIP_WORLD_INSTALL to not touch world stages (fast kernel rebuild)
Aleksandr Rybalko <ray@ddteam.net>
parents: 372
diff changeset
434 .if !defined(SKIP_WORLD_INSTALL)
147
8ff9b4cc25d5 Add contrib/racoon2, target/sbin/racoon2 - fast way to have worked IPSec
ray@terran.dlink.ua
parents: 138
diff changeset
435 @echo "XXX: need to find a way to install required includes correctly"
335
49c9f1c57ecb fix typo
ray@terran.dlink.ua
parents: 322
diff changeset
436 mkdir -p ${ZROUTER_FREEBSD_OBJDIR}/tmp/usr/include/lzo
321
4445eeeff278 Tidy up main Makefile. make lines shortest.
ray@terran.dlink.ua
parents: 315
diff changeset
437 MAKEOBJDIRPREFIX=${ZROUTER_OBJ}/tmp/ ${MAKE} ${_WORLD_BUILD_ENV} \
4445eeeff278 Tidy up main Makefile. make lines shortest.
ray@terran.dlink.ua
parents: 315
diff changeset
438 SUBDIR_OVERRIDE="${WORLD_SUBDIRS}" -C ${FREEBSD_SRC_TREE} \
4445eeeff278 Tidy up main Makefile. make lines shortest.
ray@terran.dlink.ua
parents: 315
diff changeset
439 buildworld
392
67a61a0c4cdb * Add SKIP_WORLD_INSTALL to not touch world stages (fast kernel rebuild)
Aleksandr Rybalko <ray@ddteam.net>
parents: 372
diff changeset
440 .endif
16
1091c99a69ff savepoint: world started
ray
parents: 15
diff changeset
441
34
5ac48ba8d8d1 create rootfs dir befor installworld
ray
parents: 30
diff changeset
442 world-install: rootfs-dir
392
67a61a0c4cdb * Add SKIP_WORLD_INSTALL to not touch world stages (fast kernel rebuild)
Aleksandr Rybalko <ray@ddteam.net>
parents: 372
diff changeset
443 .if !defined(SKIP_WORLD_INSTALL)
321
4445eeeff278 Tidy up main Makefile. make lines shortest.
ray@terran.dlink.ua
parents: 315
diff changeset
444 MAKEOBJDIRPREFIX=${ZROUTER_OBJ}/tmp/ ${MAKE} ${_WORLD_BUILD_ENV} \
4445eeeff278 Tidy up main Makefile. make lines shortest.
ray@terran.dlink.ua
parents: 315
diff changeset
445 ${_WORLD_INSTALL_ENV} SUBDIR_OVERRIDE="${WORLD_SUBDIRS}" \
4445eeeff278 Tidy up main Makefile. make lines shortest.
ray@terran.dlink.ua
parents: 315
diff changeset
446 DESTDIR=${WORLDDESTDIR} -C ${FREEBSD_SRC_TREE} installworld
392
67a61a0c4cdb * Add SKIP_WORLD_INSTALL to not touch world stages (fast kernel rebuild)
Aleksandr Rybalko <ray@ddteam.net>
parents: 372
diff changeset
447 .endif
28
1b97602dd5bd openvpn builded and installed
ray@terran.dlink.ua
parents: 27
diff changeset
448
95
91ceb933eeff ADAPTATION rc.d script example
ray@terran.dlink.ua
parents: 93
diff changeset
449 world-fix-lib-links:
123
25b9dfe55e92 Hide echo commands by Luiz
ray@terran.dlink.ua
parents: 113
diff changeset
450 @echo "++++++++++++++ Making [email protected] ++++++++++++++"
95
91ceb933eeff ADAPTATION rc.d script example
ray@terran.dlink.ua
parents: 93
diff changeset
451 cd ${WORLDDESTDIR}/usr/lib/ && ${ZROUTER_ROOT}/tools/fix_lib_links.sh
91ceb933eeff ADAPTATION rc.d script example
ray@terran.dlink.ua
parents: 93
diff changeset
452
201
3b87524c2bed cleanup
ray@terran.dlink.ua
parents: 192
diff changeset
453 world: build-verify build-info world-toolchain world-build world-install world-fix-lib-links
3b87524c2bed cleanup
ray@terran.dlink.ua
parents: 192
diff changeset
454 .ORDER: build-verify build-info world-toolchain world-build world-install world-fix-lib-links
16
1091c99a69ff savepoint: world started
ray
parents: 15
diff changeset
455
73
1068cdce09a2 tidy up
ray@terran.dlink.ua
parents: 72
diff changeset
456 .include "share/mk/zrouter.ports.mk"
70
bfed845746cc image creating, add old lzma
ray
parents: 68
diff changeset
457
202
02c1a507ea30 Allow to specify TARGET_CPUARCH in soc.mk or board.mk
ray@terran.dlink.ua
parents: 201
diff changeset
458 rootfs-dir!
34
5ac48ba8d8d1 create rootfs dir befor installworld
ray
parents: 30
diff changeset
459 mkdir -p ${WORLDDESTDIR}
202
02c1a507ea30 Allow to specify TARGET_CPUARCH in soc.mk or board.mk
ray@terran.dlink.ua
parents: 201
diff changeset
460 mkdir -p ${WORLDDESTDIR}/usr/lib/lua/ || true
02c1a507ea30 Allow to specify TARGET_CPUARCH in soc.mk or board.mk
ray@terran.dlink.ua
parents: 201
diff changeset
461 mkdir -p ${WORLDDESTDIR}/usr/local/bin/ || true
02c1a507ea30 Allow to specify TARGET_CPUARCH in soc.mk or board.mk
ray@terran.dlink.ua
parents: 201
diff changeset
462 mkdir -p ${WORLDDESTDIR}/usr/local/sbin/ || true
113
f0f44909f9dd lua-web++
ray@terran.dlink.ua
parents: 105
diff changeset
463 for dir in ${PREINSTALLDIRS}; do mkdir -p ${WORLDDESTDIR}/$${dir}; done
34
5ac48ba8d8d1 create rootfs dir befor installworld
ray
parents: 30
diff changeset
464
5ac48ba8d8d1 create rootfs dir befor installworld
ray
parents: 30
diff changeset
465 kernel-install-dir:
5ac48ba8d8d1 create rootfs dir befor installworld
ray
parents: 30
diff changeset
466 mkdir -p ${KERNELDESTDIR}
5ac48ba8d8d1 create rootfs dir befor installworld
ray
parents: 30
diff changeset
467
30
854e78f2041e builded :)
ray
parents: 29
diff changeset
468 ports: port-build
16
1091c99a69ff savepoint: world started
ray
parents: 15
diff changeset
469
1091c99a69ff savepoint: world started
ray
parents: 15
diff changeset
470
8
853f1379ffd2 build system save point
ray
parents: 4
diff changeset
471 .if defined(KERNEL_COMPRESSION)
853f1379ffd2 build system save point
ray
parents: 4
diff changeset
472 kernel_image: kernel_deflate kernel
853f1379ffd2 build system save point
ray
parents: 4
diff changeset
473 .else
11
fd1f3cd8c153 savepoint, kernel config, cleandep, dep - DONE
ray
parents: 9
diff changeset
474 kernel_image: kernel-build
8
853f1379ffd2 build system save point
ray
parents: 4
diff changeset
475 .endif
853f1379ffd2 build system save point
ray
parents: 4
diff changeset
476
4
c933ff2ea376 profiles layout, user or board config can set many profiles (minimal SMALL_, +openvpn, +racoon etc.), then build must check size with board flash size
ray@terran.dlink.ua
parents: 2
diff changeset
477
8
853f1379ffd2 build system save point
ray
parents: 4
diff changeset
478 .if target(bootloader_image)
853f1379ffd2 build system save point
ray
parents: 4
diff changeset
479 FIRMWARE_IMAGE_DEPEND+=bootloader_image
853f1379ffd2 build system save point
ray
parents: 4
diff changeset
480 .endif
853f1379ffd2 build system save point
ray
parents: 4
diff changeset
481 .if target(config_image)
853f1379ffd2 build system save point
ray
parents: 4
diff changeset
482 FIRMWARE_IMAGE_DEPEND+=config_image
853f1379ffd2 build system save point
ray
parents: 4
diff changeset
483 .endif
853f1379ffd2 build system save point
ray
parents: 4
diff changeset
484 .if target(kernel_image)
853f1379ffd2 build system save point
ray
parents: 4
diff changeset
485 FIRMWARE_IMAGE_DEPEND+=kernel_image
853f1379ffd2 build system save point
ray
parents: 4
diff changeset
486 .endif
853f1379ffd2 build system save point
ray
parents: 4
diff changeset
487 .if target(rootfs_image)
853f1379ffd2 build system save point
ray
parents: 4
diff changeset
488 FIRMWARE_IMAGE_DEPEND+=rootfs_image
853f1379ffd2 build system save point
ray
parents: 4
diff changeset
489 .endif
853f1379ffd2 build system save point
ray
parents: 4
diff changeset
490
853f1379ffd2 build system save point
ray
parents: 4
diff changeset
491 firmware_image: ${FIRMWARE_IMAGE_DEPEND}
853f1379ffd2 build system save point
ray
parents: 4
diff changeset
492
853f1379ffd2 build system save point
ray
parents: 4
diff changeset
493 image: firmware_image
853f1379ffd2 build system save point
ray
parents: 4
diff changeset
494
15
73b96233b7e3 kernel build/install done, and cleaned
ray@terran.dlink.ua
parents: 14
diff changeset
495 buildimage: ${BUILD_IMAGE_DEPEND}
9
c104810019a0 buildenv savepoint kernconf/kern.hints generating
ray@terran.dlink.ua
parents: 8
diff changeset
496
c104810019a0 buildenv savepoint kernconf/kern.hints generating
ray@terran.dlink.ua
parents: 8
diff changeset
497
68
319b8e8bd547 image preparation rules
ray
parents: 47
diff changeset
498 # XXX Must make makefs, mkulzma with [kernel-]toolchain + uboot_mkimage and old lzma ports
15
73b96233b7e3 kernel build/install done, and cleaned
ray@terran.dlink.ua
parents: 14
diff changeset
499
372
be25d96a82f6 Defaulting image suffix with NEW_IMAGE_TYPE value
ray@terran.dlink.ua
parents: 366
diff changeset
500 IMAGE_SUFFIX?= ${NEW_IMAGE_TYPE}
76
f6fba87a95a6 NQ-900 tune
ray@terran.dlink.ua
parents: 75
diff changeset
501 ZTOOLS_PATH=${ZROUTER_OBJ}/ztools
70
bfed845746cc image creating, add old lzma
ray
parents: 68
diff changeset
502 NEW_KERNEL=${ZROUTER_OBJ}/${TARGET_VENDOR}_${TARGET_DEVICE}_kernel
bfed845746cc image creating, add old lzma
ray
parents: 68
diff changeset
503 NEW_ROOTFS=${ZROUTER_OBJ}/${TARGET_VENDOR}_${TARGET_DEVICE}_rootfs_clean
77
892fe262132e NorthQ_NQ-900.trx build/run fine, but not etc yet
ray@terran.dlink.ua
parents: 76
diff changeset
504 NEW_IMAGE=${ZROUTER_OBJ}/${TARGET_VENDOR}_${TARGET_DEVICE}.${IMAGE_SUFFIX}
70
bfed845746cc image creating, add old lzma
ray
parents: 68
diff changeset
505
74
ray@terran.dlink.ua
parents: 73
diff changeset
506 IMAGE_BUILD_PATHS=${ZTOOLS_PATH}:${FREEBSD_BUILD_ENV_PATH}
ray@terran.dlink.ua
parents: 73
diff changeset
507
ray@terran.dlink.ua
parents: 73
diff changeset
508 .include "share/mk/zrouter.local.tools.mk"
87
96b52a080f89 NQ-901 begin
ray@terran.dlink.ua
parents: 86
diff changeset
509 .include "share/mk/zrouter.base.tools.mk"
68
319b8e8bd547 image preparation rules
ray
parents: 47
diff changeset
510
177
b468382c0a08 fix ability to do non-cross builds
ray@terran.dlink.ua
parents: 171
diff changeset
511 .if !defined(ROOTFS_WITH_KERNEL)
b468382c0a08 fix ability to do non-cross builds
ray@terran.dlink.ua
parents: 171
diff changeset
512 _FIND_MATCH_KERNEL=-name kernel -or
b468382c0a08 fix ability to do non-cross builds
ray@terran.dlink.ua
parents: 171
diff changeset
513 .endif
b468382c0a08 fix ability to do non-cross builds
ray@terran.dlink.ua
parents: 171
diff changeset
514
70
bfed845746cc image creating, add old lzma
ray
parents: 68
diff changeset
515 ROOTFS_RMLIST= \
bfed845746cc image creating, add old lzma
ray
parents: 68
diff changeset
516 \\( \\( -type f -or -type l \\) -and \
177
b468382c0a08 fix ability to do non-cross builds
ray@terran.dlink.ua
parents: 171
diff changeset
517 \\( ${_FIND_MATCH_KERNEL} -name "*.a" -or -name "crt*.o" \\) \\) -or \
70
bfed845746cc image creating, add old lzma
ray
parents: 68
diff changeset
518 \\( -type l -and -name sys \\) -or \
bfed845746cc image creating, add old lzma
ray
parents: 68
diff changeset
519 \\( -type d -and \\( \
bfed845746cc image creating, add old lzma
ray
parents: 68
diff changeset
520 -name include -or \
bfed845746cc image creating, add old lzma
ray
parents: 68
diff changeset
521 -name libdata -or \
bfed845746cc image creating, add old lzma
ray
parents: 68
diff changeset
522 -name games -or \
bfed845746cc image creating, add old lzma
ray
parents: 68
diff changeset
523 -name src -or \
bfed845746cc image creating, add old lzma
ray
parents: 68
diff changeset
524 -name obj -or \
bfed845746cc image creating, add old lzma
ray
parents: 68
diff changeset
525 -name info -or \
bfed845746cc image creating, add old lzma
ray
parents: 68
diff changeset
526 -name man -or \
bfed845746cc image creating, add old lzma
ray
parents: 68
diff changeset
527 -name zfs \\) \\)
bfed845746cc image creating, add old lzma
ray
parents: 68
diff changeset
528
91
fef55b0f6b99 many parts
ray@terran.dlink.ua
parents: 90
diff changeset
529 ROOTFS_RMFILES+=calendar dict doc examples groff_font locale me mk nls openssl \
fef55b0f6b99 many parts
ray@terran.dlink.ua
parents: 90
diff changeset
530 pc-sysinstall security sendmail skel syscons tabset tmac vi zoneinfo
fef55b0f6b99 many parts
ray@terran.dlink.ua
parents: 90
diff changeset
531
70
bfed845746cc image creating, add old lzma
ray
parents: 68
diff changeset
532 # Move kernel out of rootfs
bfed845746cc image creating, add old lzma
ray
parents: 68
diff changeset
533 # world kernel ports
252
09aa4832178e Invoke "Packing magic"
ray@terran.dlink.ua
parents: 249
diff changeset
534 rootfs: ${ZROUTER_OBJ}/${TARGET_VENDOR}_${TARGET_DEVICE}_rootfs_clean
09aa4832178e Invoke "Packing magic"
ray@terran.dlink.ua
parents: 249
diff changeset
535
305
c230dd90b13a add WITHOUT_ATM=yes option
ray@terran.dlink.ua
parents: 304
diff changeset
536 ROOTFS_CLEAN_MTREE_FILE= ${ZROUTER_OBJ}/${TARGET_VENDOR}_${TARGET_DEVICE}_rootfs_clean.mtree
252
09aa4832178e Invoke "Packing magic"
ray@terran.dlink.ua
parents: 249
diff changeset
537
09aa4832178e Invoke "Packing magic"
ray@terran.dlink.ua
parents: 249
diff changeset
538 ${ZROUTER_OBJ}/${TARGET_VENDOR}_${TARGET_DEVICE}_rootfs_clean: ${KERNELDESTDIR}/boot/kernel/kernel ${ROOTFS_DEPTEST}
85
ced593160863 makefile tune
ray
parents: 83
diff changeset
539 for d in ${ROOTFS_COPY_DIRS} ; do \
ced593160863 makefile tune
ray
parents: 83
diff changeset
540 for f in `( cd $${d} ; find . -type f )` ; do \
ced593160863 makefile tune
ray
parents: 83
diff changeset
541 mkdir -p `dirname ${WORLDDESTDIR}/$${f}` ; \
ced593160863 makefile tune
ray
parents: 83
diff changeset
542 cp $${d}/$${f} ${WORLDDESTDIR}/$${f} ; \
ced593160863 makefile tune
ray
parents: 83
diff changeset
543 done ; \
ced593160863 makefile tune
ray
parents: 83
diff changeset
544 done
70
bfed845746cc image creating, add old lzma
ray
parents: 68
diff changeset
545 rm -f ${NEW_KERNEL}
bfed845746cc image creating, add old lzma
ray
parents: 68
diff changeset
546 cp ${KERNELDESTDIR}/boot/kernel/kernel ${NEW_KERNEL}
bfed845746cc image creating, add old lzma
ray
parents: 68
diff changeset
547 rm -rf ${ZROUTER_OBJ}/${TARGET_VENDOR}_${TARGET_DEVICE}_rootfs_clean
bfed845746cc image creating, add old lzma
ray
parents: 68
diff changeset
548 cp -R ${WORLDDESTDIR} ${NEW_ROOTFS}
bfed845746cc image creating, add old lzma
ray
parents: 68
diff changeset
549 rm -rf `find ${NEW_ROOTFS} ${ROOTFS_RMLIST}`
91
fef55b0f6b99 many parts
ray@terran.dlink.ua
parents: 90
diff changeset
550 for file in ${ROOTFS_RMFILES} ; do rm -rf ${NEW_ROOTFS}/usr/share/$${file} ; done
90
89de91c025a5 +mpd +shttpd +dlink_web
ray@terran.dlink.ua
parents: 89
diff changeset
551 rm -rf ${NEW_ROOTFS}/var
89de91c025a5 +mpd +shttpd +dlink_web
ray@terran.dlink.ua
parents: 89
diff changeset
552 ln -s /tmp/var ${NEW_ROOTFS}/var
89de91c025a5 +mpd +shttpd +dlink_web
ray@terran.dlink.ua
parents: 89
diff changeset
553 rm -f ${NEW_ROOTFS}/etc/resolv.conf
89de91c025a5 +mpd +shttpd +dlink_web
ray@terran.dlink.ua
parents: 89
diff changeset
554 ln -s /tmp/etc/resolv.conf ${NEW_ROOTFS}/etc/resolv.conf
91
fef55b0f6b99 many parts
ray@terran.dlink.ua
parents: 90
diff changeset
555 cd ${NEW_ROOTFS}/bin/ ; \
fef55b0f6b99 many parts
ray@terran.dlink.ua
parents: 90
diff changeset
556 ln -sf rm unlink ; \
fef55b0f6b99 many parts
ray@terran.dlink.ua
parents: 90
diff changeset
557 ln -sf ln link
fef55b0f6b99 many parts
ray@terran.dlink.ua
parents: 90
diff changeset
558 cd ${NEW_ROOTFS}/sbin/ ; \
fef55b0f6b99 many parts
ray@terran.dlink.ua
parents: 90
diff changeset
559 ln -sf reboot halt ; \
fef55b0f6b99 many parts
ray@terran.dlink.ua
parents: 90
diff changeset
560 ln -sf reboot fastboot ; \
fef55b0f6b99 many parts
ray@terran.dlink.ua
parents: 90
diff changeset
561 ln -sf reboot fasthalt ; \
fef55b0f6b99 many parts
ray@terran.dlink.ua
parents: 90
diff changeset
562 ln -sf md5 rmd160 ; \
fef55b0f6b99 many parts
ray@terran.dlink.ua
parents: 90
diff changeset
563 ln -sf md5 sha1 ; \
fef55b0f6b99 many parts
ray@terran.dlink.ua
parents: 90
diff changeset
564 ln -sf md5 sha256
fef55b0f6b99 many parts
ray@terran.dlink.ua
parents: 90
diff changeset
565 cd ${NEW_ROOTFS}/usr/bin/ ; \
fef55b0f6b99 many parts
ray@terran.dlink.ua
parents: 90
diff changeset
566 ln -sf id groups ; \
fef55b0f6b99 many parts
ray@terran.dlink.ua
parents: 90
diff changeset
567 ln -sf id whoami ; \
135
360449c713f1 switch to bsdgrep
ray@terran.dlink.ua
parents: 132
diff changeset
568 ln -sf bsdgrep grep ; \
360449c713f1 switch to bsdgrep
ray@terran.dlink.ua
parents: 132
diff changeset
569 ln -sf bsdgrep egrep ; \
360449c713f1 switch to bsdgrep
ray@terran.dlink.ua
parents: 132
diff changeset
570 ln -sf bsdgrep fgrep ; \
360449c713f1 switch to bsdgrep
ray@terran.dlink.ua
parents: 132
diff changeset
571 ln -sf bsdgrep zgrep ; \
360449c713f1 switch to bsdgrep
ray@terran.dlink.ua
parents: 132
diff changeset
572 ln -sf bsdgrep zegrep ; \
360449c713f1 switch to bsdgrep
ray@terran.dlink.ua
parents: 132
diff changeset
573 ln -sf bsdgrep zfgrep ; \
310
0c314d339445 Fix new grep links.
ray@terran.dlink.ua
parents: 307
diff changeset
574 ln -sf bsdgrep lzegrep ; \
0c314d339445 Fix new grep links.
ray@terran.dlink.ua
parents: 307
diff changeset
575 ln -sf bsdgrep lzfgrep ; \
0c314d339445 Fix new grep links.
ray@terran.dlink.ua
parents: 307
diff changeset
576 ln -sf bsdgrep lzgrep ; \
0c314d339445 Fix new grep links.
ray@terran.dlink.ua
parents: 307
diff changeset
577 ln -sf bsdgrep xzegrep ; \
0c314d339445 Fix new grep links.
ray@terran.dlink.ua
parents: 307
diff changeset
578 ln -sf bsdgrep xzfgrep ; \
0c314d339445 Fix new grep links.
ray@terran.dlink.ua
parents: 307
diff changeset
579 ln -sf bsdgrep xzgrep ; \
91
fef55b0f6b99 many parts
ray@terran.dlink.ua
parents: 90
diff changeset
580 ln -sf ssh slogin ; \
fef55b0f6b99 many parts
ray@terran.dlink.ua
parents: 90
diff changeset
581 ln -sf vi nvi ; \
fef55b0f6b99 many parts
ray@terran.dlink.ua
parents: 90
diff changeset
582 ln -sf vi ex ; \
fef55b0f6b99 many parts
ray@terran.dlink.ua
parents: 90
diff changeset
583 ln -sf vi nex ; \
fef55b0f6b99 many parts
ray@terran.dlink.ua
parents: 90
diff changeset
584 ln -sf vi view ; \
fef55b0f6b99 many parts
ray@terran.dlink.ua
parents: 90
diff changeset
585 ln -sf vi nview
90
89de91c025a5 +mpd +shttpd +dlink_web
ray@terran.dlink.ua
parents: 89
diff changeset
586 rm -rf ${NEW_ROOTFS}/etc/mpd
89de91c025a5 +mpd +shttpd +dlink_web
ray@terran.dlink.ua
parents: 89
diff changeset
587 ln -s /tmp/etc/mpd ${NEW_ROOTFS}/etc/mpd
392
67a61a0c4cdb * Add SKIP_WORLD_INSTALL to not touch world stages (fast kernel rebuild)
Aleksandr Rybalko <ray@ddteam.net>
parents: 372
diff changeset
588 hg --repository "${ZROUTER_ROOT}" tip \
424
2e4f82453446 Add build date to /etc/zrouter_version on rootfs build.
Aleksandr Rybalko <ray@ddteam.net>
parents: 415
diff changeset
589 --template 'revision="{rev}"\ndate="{date|isodate}"\n' > \
2e4f82453446 Add build date to /etc/zrouter_version on rootfs build.
Aleksandr Rybalko <ray@ddteam.net>
parents: 415
diff changeset
590 "${NEW_ROOTFS}/etc/zrouter_version"
2e4f82453446 Add build date to /etc/zrouter_version on rootfs build.
Aleksandr Rybalko <ray@ddteam.net>
parents: 415
diff changeset
591 LANG=C date '+build="%Y-%m-%d %H:%M:%S"' >> \
392
67a61a0c4cdb * Add SKIP_WORLD_INSTALL to not touch world stages (fast kernel rebuild)
Aleksandr Rybalko <ray@ddteam.net>
parents: 372
diff changeset
592 "${NEW_ROOTFS}/etc/zrouter_version"
305
c230dd90b13a add WITHOUT_ATM=yes option
ray@terran.dlink.ua
parents: 304
diff changeset
593 cd ${ZROUTER_OBJ}/${TARGET_VENDOR}_${TARGET_DEVICE}_rootfs_clean ; \
c230dd90b13a add WITHOUT_ATM=yes option
ray@terran.dlink.ua
parents: 304
diff changeset
594 find ./usr/ -type d -empty -delete
c230dd90b13a add WITHOUT_ATM=yes option
ray@terran.dlink.ua
parents: 304
diff changeset
595 cd ${ZROUTER_OBJ}/${TARGET_VENDOR}_${TARGET_DEVICE}_rootfs_clean ; \
c230dd90b13a add WITHOUT_ATM=yes option
ray@terran.dlink.ua
parents: 304
diff changeset
596 mtree -c -i -n -k uname,gname,mode,nochange | \
c230dd90b13a add WITHOUT_ATM=yes option
ray@terran.dlink.ua
parents: 304
diff changeset
597 sed -E 's/uname=[[:alnum:]]+/uname=root/' | \
c230dd90b13a add WITHOUT_ATM=yes option
ray@terran.dlink.ua
parents: 304
diff changeset
598 sed -E 's/gname=[[:alnum:]]+/gname=wheel/' > \
c230dd90b13a add WITHOUT_ATM=yes option
ray@terran.dlink.ua
parents: 304
diff changeset
599 ${ROOTFS_CLEAN_MTREE_FILE}
70
bfed845746cc image creating, add old lzma
ray
parents: 68
diff changeset
600
95
91ceb933eeff ADAPTATION rc.d script example
ray@terran.dlink.ua
parents: 93
diff changeset
601 ${ROOTFS_DEPTEST}: world ports
123
25b9dfe55e92 Hide echo commands by Luiz
ray@terran.dlink.ua
parents: 113
diff changeset
602 @echo "++++++++++++++ Making [email protected] ++++++++++++++"
81
ray
parents:
diff changeset
603
321
4445eeeff278 Tidy up main Makefile. make lines shortest.
ray@terran.dlink.ua
parents: 315
diff changeset
604 ${ZROUTER_FREEBSD_OBJDIR}/sys/${KERNEL_CONFIG_FILE}/kernel: kernel-build
123
25b9dfe55e92 Hide echo commands by Luiz
ray@terran.dlink.ua
parents: 113
diff changeset
605 @echo "++++++++++++++ Making [email protected] ++++++++++++++"
321
4445eeeff278 Tidy up main Makefile. make lines shortest.
ray@terran.dlink.ua
parents: 315
diff changeset
606 echo "XXXXXXXXXXXXX ${ZROUTER_FREEBSD_OBJDIR}/sys/${KERNEL_CONFIG_FILE}/kernel"
85
ced593160863 makefile tune
ray
parents: 83
diff changeset
607
91
fef55b0f6b99 many parts
ray@terran.dlink.ua
parents: 90
diff changeset
608 kernel-install: ${KERNELDESTDIR}/boot/kernel/kernel
fef55b0f6b99 many parts
ray@terran.dlink.ua
parents: 90
diff changeset
609
321
4445eeeff278 Tidy up main Makefile. make lines shortest.
ray@terran.dlink.ua
parents: 315
diff changeset
610 ${KERNELDESTDIR}/boot/kernel/kernel: ${ZROUTER_FREEBSD_OBJDIR}/sys/${KERNEL_CONFIG_FILE}/kernel kernel-install-dir
123
25b9dfe55e92 Hide echo commands by Luiz
ray@terran.dlink.ua
parents: 113
diff changeset
611 @echo "++++++++++++++ Making [email protected] ++++++++++++++"
85
ced593160863 makefile tune
ray
parents: 83
diff changeset
612 .if !empty(KERNELDESTDIR)
ced593160863 makefile tune
ray
parents: 83
diff changeset
613 MAKEOBJDIRPREFIX=${ZROUTER_OBJ}/tmp/ ${MAKE} ${_KERNEL_BUILD_ENV} -C ${FREEBSD_SRC_TREE} DESTDIR=${KERNELDESTDIR} KERNCONF=${KERNEL_CONFIG_FILE} installkernel
ced593160863 makefile tune
ray
parents: 83
diff changeset
614 .else
ced593160863 makefile tune
ray
parents: 83
diff changeset
615 .error "KERNELDESTDIR must be set for kernel-install, since we always do cross-build"
ced593160863 makefile tune
ray
parents: 83
diff changeset
616 .endif
81
ray
parents:
diff changeset
617
ray
parents:
diff changeset
618 ${NEW_KERNEL}: ${KERNELDESTDIR}/boot/kernel/kernel
123
25b9dfe55e92 Hide echo commands by Luiz
ray@terran.dlink.ua
parents: 113
diff changeset
619 @echo "++++++++++++++ Making [email protected] ++++++++++++++"
85
ced593160863 makefile tune
ray
parents: 83
diff changeset
620 rm -f ${NEW_KERNEL}
ced593160863 makefile tune
ray
parents: 83
diff changeset
621 cp ${KERNELDESTDIR}/boot/kernel/kernel ${NEW_KERNEL}
81
ray
parents:
diff changeset
622
252
09aa4832178e Invoke "Packing magic"
ray@terran.dlink.ua
parents: 249
diff changeset
623 MKULZMA_FLAGS?=-v
09aa4832178e Invoke "Packing magic"
ray@terran.dlink.ua
parents: 249
diff changeset
624 MKULZMA_BLOCKSIZE?=131072
233
2d77e9022fda revert suffix based build for now
ray@terran.dlink.ua
parents: 232
diff changeset
625
304
6b92e391b312 Define tplink_image
ray@terran.dlink.ua
parents: 292
diff changeset
626 ZROUTER_VERSION?= 0.1-ALPHA
267
2377375b221c update usage of ubnt-mkfwimage with kernel load address + kernel entry point
ray@terran.dlink.ua
parents: 263
diff changeset
627
304
6b92e391b312 Define tplink_image
ray@terran.dlink.ua
parents: 292
diff changeset
628 KERNCONF_KERNENTRYPOINT?= ${KERNCONF_KERNLOADADDR}
6b92e391b312 Define tplink_image
ray@terran.dlink.ua
parents: 292
diff changeset
629
321
4445eeeff278 Tidy up main Makefile. make lines shortest.
ray@terran.dlink.ua
parents: 315
diff changeset
630 .warning Load address: ${KERNCONF_KERNLOADADDR} Entry point: ${KERNCONF_KERNENTRYPOINT}
4445eeeff278 Tidy up main Makefile. make lines shortest.
ray@terran.dlink.ua
parents: 315
diff changeset
631
304
6b92e391b312 Define tplink_image
ray@terran.dlink.ua
parents: 292
diff changeset
632 UBOOT_KERNEL_LOAD_ADDRESS?= ${KERNCONF_KERNLOADADDR}
6b92e391b312 Define tplink_image
ray@terran.dlink.ua
parents: 292
diff changeset
633 UBOOT_KERNEL_ENTRY_POINT?= ${KERNCONF_KERNENTRYPOINT}
267
2377375b221c update usage of ubnt-mkfwimage with kernel load address + kernel entry point
ray@terran.dlink.ua
parents: 263
diff changeset
634
304
6b92e391b312 Define tplink_image
ray@terran.dlink.ua
parents: 292
diff changeset
635 UBNT_FIRMWARE_IMAGE_SIZE_MAX?= ${FIRMWARE_IMAGE_SIZE_MAX}
6b92e391b312 Define tplink_image
ray@terran.dlink.ua
parents: 292
diff changeset
636 UBNT_KERNEL_LOAD_ADDRESS?= ${KERNCONF_KERNLOADADDR}
6b92e391b312 Define tplink_image
ray@terran.dlink.ua
parents: 292
diff changeset
637 UBNT_KERNEL_ENTRY_POINT?= ${KERNCONF_KERNENTRYPOINT}
6b92e391b312 Define tplink_image
ray@terran.dlink.ua
parents: 292
diff changeset
638 UBNT_KERNEL_FLASH_BASE?= 0xbf030000
233
2d77e9022fda revert suffix based build for now
ray@terran.dlink.ua
parents: 232
diff changeset
639
304
6b92e391b312 Define tplink_image
ray@terran.dlink.ua
parents: 292
diff changeset
640 TPLINK_KERN_LOADADDR?= ${KERNCONF_KERNLOADADDR}
6b92e391b312 Define tplink_image
ray@terran.dlink.ua
parents: 292
diff changeset
641 TPLINK_KERN_STARTADDR?= ${KERNCONF_KERNENTRYPOINT}
6b92e391b312 Define tplink_image
ray@terran.dlink.ua
parents: 292
diff changeset
642 TPLINK_IMG_NAME?= ZRouter.org
6b92e391b312 Define tplink_image
ray@terran.dlink.ua
parents: 292
diff changeset
643 TPLINK_IMG_VERSION?= ${ZROUTER_VERSION}
252
09aa4832178e Invoke "Packing magic"
ray@terran.dlink.ua
parents: 249
diff changeset
644
254
1df90b4e4716 fix trx build
ray@terran.dlink.ua
parents: 252
diff changeset
645 KERNEL_PACKED_NAME=${ZROUTER_OBJ}/${TARGET_VENDOR}_${TARGET_DEVICE}_${PACKING_KERNEL_IMAGE}
1df90b4e4716 fix trx build
ray@terran.dlink.ua
parents: 252
diff changeset
646 ROOTFS_PACKED_NAME=${ZROUTER_OBJ}/${TARGET_VENDOR}_${TARGET_DEVICE}_${PACKING_ROOTFS_IMAGE}
1df90b4e4716 fix trx build
ray@terran.dlink.ua
parents: 252
diff changeset
647
1df90b4e4716 fix trx build
ray@terran.dlink.ua
parents: 252
diff changeset
648 PACKING_TARGET_LIST:=${KERNEL_PACKED_NAME} ${ROOTFS_PACKED_NAME}
252
09aa4832178e Invoke "Packing magic"
ray@terran.dlink.ua
parents: 249
diff changeset
649 .warning "PACKING_KERNEL_IMAGE=${PACKING_TARGET_LIST}"
09aa4832178e Invoke "Packing magic"
ray@terran.dlink.ua
parents: 249
diff changeset
650 .include "share/mk/zrouter.packing.mk"
177
b468382c0a08 fix ability to do non-cross builds
ray@terran.dlink.ua
parents: 171
diff changeset
651
254
1df90b4e4716 fix trx build
ray@terran.dlink.ua
parents: 252
diff changeset
652 #
1df90b4e4716 fix trx build
ray@terran.dlink.ua
parents: 252
diff changeset
653 # TODO: comment here
1df90b4e4716 fix trx build
ray@terran.dlink.ua
parents: 252
diff changeset
654 #
275
54eaf8c60356 Define variable with target image, so we no longer need to build kernel and
ray@terran.dlink.ua
parents: 267
diff changeset
655 trximage ${NEW_MAGE}: ${KERNEL_PACKED_NAME} ${ROOTFS_PACKED_NAME} ${ZTOOLS_PATH}/asustrx
233
2d77e9022fda revert suffix based build for now
ray@terran.dlink.ua
parents: 232
diff changeset
656 @echo "++++++++++++++ Making [email protected] ++++++++++++++"
254
1df90b4e4716 fix trx build
ray@terran.dlink.ua
parents: 252
diff changeset
657 PATH=${IMAGE_BUILD_PATHS} asustrx -o ${NEW_IMAGE} ${KERNEL_PACKED_NAME} ${ROOTFS_PACKED_NAME}
77
892fe262132e NorthQ_NQ-900.trx build/run fine, but not etc yet
ray@terran.dlink.ua
parents: 76
diff changeset
658
132
23f806082313 add zimage target, to make zrouter firmware. kernel.oldlzma.uboot + padding to 64k block + rootfs.ulzma
ray@terran.dlink.ua
parents: 124
diff changeset
659 # zimage used when it possible to use any formats (CFI devices must use trx
23f806082313 add zimage target, to make zrouter firmware. kernel.oldlzma.uboot + padding to 64k block + rootfs.ulzma
ray@terran.dlink.ua
parents: 124
diff changeset
660 # format, but U-Boot devices must use only kernel in U-Boot format )
254
1df90b4e4716 fix trx build
ray@terran.dlink.ua
parents: 252
diff changeset
661 zimage: ${KERNEL_PACKED_NAME} ${ROOTFS_PACKED_NAME}
275
54eaf8c60356 Define variable with target image, so we no longer need to build kernel and
ray@terran.dlink.ua
parents: 267
diff changeset
662 cat ${KERNEL_PACKED_NAME} ${ROOTFS_PACKED_NAME} ${BOARD_FIRMWARE_SIGNATURE_FILE} > ${NEW_IMAGE}
132
23f806082313 add zimage target, to make zrouter firmware. kernel.oldlzma.uboot + padding to 64k block + rootfs.ulzma
ray@terran.dlink.ua
parents: 124
diff changeset
663 IMGMD5=`md5 ${NEW_IMAGE} | cut -f4 -d' '` ; \
23f806082313 add zimage target, to make zrouter firmware. kernel.oldlzma.uboot + padding to 64k block + rootfs.ulzma
ray@terran.dlink.ua
parents: 124
diff changeset
664 cp ${NEW_IMAGE} ${ZROUTER_OBJ}/${TARGET_VENDOR}_${TARGET_DEVICE}-${ZROUTER_VERSION}.$${IMGMD5}.${IMAGE_SUFFIX}
23f806082313 add zimage target, to make zrouter firmware. kernel.oldlzma.uboot + padding to 64k block + rootfs.ulzma
ray@terran.dlink.ua
parents: 124
diff changeset
665
263
3782f2da7fe2 fix for not ubntimage targtes
ray@terran.dlink.ua
parents: 256
diff changeset
666 .if target(ubntimage)
256
a04a4ecc8470 define ubntimage target to build RS/RSPRO firmware
ray@terran.dlink.ua
parents: 254
diff changeset
667 .if !defined(UBNT_VERSION) || empty(UBNT_VERSION)
a04a4ecc8470 define ubntimage target to build RS/RSPRO firmware
ray@terran.dlink.ua
parents: 254
diff changeset
668 .error Specify UBNT_VERSION or device will not accept firmware
a04a4ecc8470 define ubntimage target to build RS/RSPRO firmware
ray@terran.dlink.ua
parents: 254
diff changeset
669 .endif
263
3782f2da7fe2 fix for not ubntimage targtes
ray@terran.dlink.ua
parents: 256
diff changeset
670 .endif
3782f2da7fe2 fix for not ubntimage targtes
ray@terran.dlink.ua
parents: 256
diff changeset
671
256
a04a4ecc8470 define ubntimage target to build RS/RSPRO firmware
ray@terran.dlink.ua
parents: 254
diff changeset
672 ubntimage: ${KERNEL_PACKED_NAME} ${ROOTFS_PACKED_NAME} ${ZTOOLS_PATH}/ubnt-mkfwimage
a04a4ecc8470 define ubntimage target to build RS/RSPRO firmware
ray@terran.dlink.ua
parents: 254
diff changeset
673 @echo "++++++++++++++ Making [email protected] ++++++++++++++"
a04a4ecc8470 define ubntimage target to build RS/RSPRO firmware
ray@terran.dlink.ua
parents: 254
diff changeset
674 PATH=${IMAGE_BUILD_PATHS} ubnt-mkfwimage \
a04a4ecc8470 define ubntimage target to build RS/RSPRO firmware
ray@terran.dlink.ua
parents: 254
diff changeset
675 -v "${UBNT_VERSION}" \
a04a4ecc8470 define ubntimage target to build RS/RSPRO firmware
ray@terran.dlink.ua
parents: 254
diff changeset
676 -s "${UBNT_KERNEL_FLASH_BASE}" \
267
2377375b221c update usage of ubnt-mkfwimage with kernel load address + kernel entry point
ray@terran.dlink.ua
parents: 263
diff changeset
677 -l "${UBNT_KERNEL_LOAD_ADDRESS}" \
2377375b221c update usage of ubnt-mkfwimage with kernel load address + kernel entry point
ray@terran.dlink.ua
parents: 263
diff changeset
678 -e "${UBNT_KERNEL_ENTRY_POINT}" \
256
a04a4ecc8470 define ubntimage target to build RS/RSPRO firmware
ray@terran.dlink.ua
parents: 254
diff changeset
679 -m "${UBNT_FIRMWARE_IMAGE_SIZE_MAX}" \
a04a4ecc8470 define ubntimage target to build RS/RSPRO firmware
ray@terran.dlink.ua
parents: 254
diff changeset
680 -k "${KERNEL_PACKED_NAME}" \
a04a4ecc8470 define ubntimage target to build RS/RSPRO firmware
ray@terran.dlink.ua
parents: 254
diff changeset
681 -r "${ROOTFS_PACKED_NAME}" \
a04a4ecc8470 define ubntimage target to build RS/RSPRO firmware
ray@terran.dlink.ua
parents: 254
diff changeset
682 -o "${NEW_IMAGE}"
a04a4ecc8470 define ubntimage target to build RS/RSPRO firmware
ray@terran.dlink.ua
parents: 254
diff changeset
683
304
6b92e391b312 Define tplink_image
ray@terran.dlink.ua
parents: 292
diff changeset
684 # some TP-Link boards have a modified u-boot bootloader
6b92e391b312 Define tplink_image
ray@terran.dlink.ua
parents: 292
diff changeset
685 # and need "mktplinkfw" for building the firmware
6b92e391b312 Define tplink_image
ray@terran.dlink.ua
parents: 292
diff changeset
686 tplink_image: ${KERNEL_PACKED_NAME} ${ROOTFS_PACKED_NAME} ${ZTOOLS_PATH}/mktplinkfw
6b92e391b312 Define tplink_image
ray@terran.dlink.ua
parents: 292
diff changeset
687 @echo "++++++++++++++ Making [email protected] ++++++++++++++"
317
543ca52263a3 set TPLINK_ROOTFS_START to KERNEL_MAP_START + KERNEL_PACKED_SIZE, closes #22\n\nApproved by: ray
Eric Krausser <zrouter@krausser-edv.de>
parents: 315
diff changeset
688 @if [ "x${TPLINK_BOARDTYPE}" = "x" ] ; then \
304
6b92e391b312 Define tplink_image
ray@terran.dlink.ua
parents: 292
diff changeset
689 echo "TPLINK_BOARDTYPE must be defined"; \
6b92e391b312 Define tplink_image
ray@terran.dlink.ua
parents: 292
diff changeset
690 exit 1; \
6b92e391b312 Define tplink_image
ray@terran.dlink.ua
parents: 292
diff changeset
691 fi
317
543ca52263a3 set TPLINK_ROOTFS_START to KERNEL_MAP_START + KERNEL_PACKED_SIZE, closes #22\n\nApproved by: ray
Eric Krausser <zrouter@krausser-edv.de>
parents: 315
diff changeset
692 @if [ "x${KERNEL_MAP_START}" = "x" ] ; then \
543ca52263a3 set TPLINK_ROOTFS_START to KERNEL_MAP_START + KERNEL_PACKED_SIZE, closes #22\n\nApproved by: ray
Eric Krausser <zrouter@krausser-edv.de>
parents: 315
diff changeset
693 echo "KERNEL_MAP_START must be defined, this is the hint.map.?.start ";\
543ca52263a3 set TPLINK_ROOTFS_START to KERNEL_MAP_START + KERNEL_PACKED_SIZE, closes #22\n\nApproved by: ray
Eric Krausser <zrouter@krausser-edv.de>
parents: 315
diff changeset
694 echo "address from board.hints where hint.map.?.name='kernel'"; \
543ca52263a3 set TPLINK_ROOTFS_START to KERNEL_MAP_START + KERNEL_PACKED_SIZE, closes #22\n\nApproved by: ray
Eric Krausser <zrouter@krausser-edv.de>
parents: 315
diff changeset
695 exit 1; \
543ca52263a3 set TPLINK_ROOTFS_START to KERNEL_MAP_START + KERNEL_PACKED_SIZE, closes #22\n\nApproved by: ray
Eric Krausser <zrouter@krausser-edv.de>
parents: 315
diff changeset
696 fi
543ca52263a3 set TPLINK_ROOTFS_START to KERNEL_MAP_START + KERNEL_PACKED_SIZE, closes #22\n\nApproved by: ray
Eric Krausser <zrouter@krausser-edv.de>
parents: 315
diff changeset
697 KERNEL_PACKED_SIZE=`stat -f %z "${KERNEL_PACKED_NAME}"`; \
543ca52263a3 set TPLINK_ROOTFS_START to KERNEL_MAP_START + KERNEL_PACKED_SIZE, closes #22\n\nApproved by: ray
Eric Krausser <zrouter@krausser-edv.de>
parents: 315
diff changeset
698 TPLINK_ROOTFS_START=`printf "%#x" $$(( ${KERNEL_MAP_START} + $${KERNEL_PACKED_SIZE} ))`; \
304
6b92e391b312 Define tplink_image
ray@terran.dlink.ua
parents: 292
diff changeset
699 PATH=${IMAGE_BUILD_PATHS} mktplinkfw \
6b92e391b312 Define tplink_image
ray@terran.dlink.ua
parents: 292
diff changeset
700 -B ${TPLINK_BOARDTYPE} \
317
543ca52263a3 set TPLINK_ROOTFS_START to KERNEL_MAP_START + KERNEL_PACKED_SIZE, closes #22\n\nApproved by: ray
Eric Krausser <zrouter@krausser-edv.de>
parents: 315
diff changeset
701 -R $${TPLINK_ROOTFS_START} \
304
6b92e391b312 Define tplink_image
ray@terran.dlink.ua
parents: 292
diff changeset
702 -L ${TPLINK_KERN_LOADADDR} \
6b92e391b312 Define tplink_image
ray@terran.dlink.ua
parents: 292
diff changeset
703 -E ${TPLINK_KERN_STARTADDR} \
6b92e391b312 Define tplink_image
ray@terran.dlink.ua
parents: 292
diff changeset
704 -k "${KERNEL_PACKED_NAME}" \
6b92e391b312 Define tplink_image
ray@terran.dlink.ua
parents: 292
diff changeset
705 -N ${TPLINK_IMG_NAME} \
6b92e391b312 Define tplink_image
ray@terran.dlink.ua
parents: 292
diff changeset
706 -V ${TPLINK_IMG_VERSION} \
6b92e391b312 Define tplink_image
ray@terran.dlink.ua
parents: 292
diff changeset
707 -r "${ROOTFS_PACKED_NAME}" \
317
543ca52263a3 set TPLINK_ROOTFS_START to KERNEL_MAP_START + KERNEL_PACKED_SIZE, closes #22\n\nApproved by: ray
Eric Krausser <zrouter@krausser-edv.de>
parents: 315
diff changeset
708 -o "${NEW_IMAGE}" && \
543ca52263a3 set TPLINK_ROOTFS_START to KERNEL_MAP_START + KERNEL_PACKED_SIZE, closes #22\n\nApproved by: ray
Eric Krausser <zrouter@krausser-edv.de>
parents: 315
diff changeset
709 PATH=${IMAGE_BUILD_PATHS} mktplinkfw -i "${NEW_IMAGE}"
304
6b92e391b312 Define tplink_image
ray@terran.dlink.ua
parents: 292
diff changeset
710
6b92e391b312 Define tplink_image
ray@terran.dlink.ua
parents: 292
diff changeset
711
275
54eaf8c60356 Define variable with target image, so we no longer need to build kernel and
ray@terran.dlink.ua
parents: 267
diff changeset
712 split_kernel_rootfs: ${KERNEL_PACKED_NAME} ${ROOTFS_PACKED_NAME}
54eaf8c60356 Define variable with target image, so we no longer need to build kernel and
ray@terran.dlink.ua
parents: 267
diff changeset
713 touch "${NEW_IMAGE}"
54eaf8c60356 Define variable with target image, so we no longer need to build kernel and
ray@terran.dlink.ua
parents: 267
diff changeset
714
54eaf8c60356 Define variable with target image, so we no longer need to build kernel and
ray@terran.dlink.ua
parents: 267
diff changeset
715 ${NEW_IMAGE}: ${NEW_IMAGE_TYPE}
54eaf8c60356 Define variable with target image, so we no longer need to build kernel and
ray@terran.dlink.ua
parents: 267
diff changeset
716
54eaf8c60356 Define variable with target image, so we no longer need to build kernel and
ray@terran.dlink.ua
parents: 267
diff changeset
717 all: world kernel ports ${NEW_IMAGE}
54eaf8c60356 Define variable with target image, so we no longer need to build kernel and
ray@terran.dlink.ua
parents: 267
diff changeset
718
9
c104810019a0 buildenv savepoint kernconf/kern.hints generating
ray@terran.dlink.ua
parents: 8
diff changeset
719 .include <bsd.obj.mk>
8
853f1379ffd2 build system save point
ray
parents: 4
diff changeset
720
853f1379ffd2 build system save point
ray
parents: 4
diff changeset
721
853f1379ffd2 build system save point
ray
parents: 4
diff changeset
722
853f1379ffd2 build system save point
ray
parents: 4
diff changeset
723
853f1379ffd2 build system save point
ray
parents: 4
diff changeset
724
853f1379ffd2 build system save point
ray
parents: 4
diff changeset
725
853f1379ffd2 build system save point
ray
parents: 4
diff changeset
726
853f1379ffd2 build system save point
ray
parents: 4
diff changeset
727
853f1379ffd2 build system save point
ray
parents: 4
diff changeset
728
853f1379ffd2 build system save point
ray
parents: 4
diff changeset
729
853f1379ffd2 build system save point
ray
parents: 4
diff changeset
730