PageRenderTime 641ms CodeModel.GetById 25ms RepoModel.GetById 0ms app.codeStats 0ms

/Makefile

https://gitlab.com/PedroFalcato/sortix
Makefile | 436 lines | 365 code | 64 blank | 7 comment | 35 complexity | 7e54d250ebc4e32ba3ee1cc1e96601a4 MD5 | raw file
  1. SOFTWARE_MEANT_FOR_SORTIX=1
  2. include build-aux/platform.mak
  3. include build-aux/compiler.mak
  4. include build-aux/version.mak
  5. MODULES=\
  6. doc \
  7. libc \
  8. libm \
  9. dispd \
  10. libmount \
  11. bench \
  12. carray \
  13. disked \
  14. editor \
  15. ext \
  16. games \
  17. init \
  18. kblayout \
  19. kblayout-compiler \
  20. login \
  21. mkinitrd \
  22. regress \
  23. sf \
  24. sh \
  25. sysinstall \
  26. tix \
  27. trianglix \
  28. update-initrd \
  29. utils \
  30. kernel
  31. ifndef SYSROOT
  32. SYSROOT:=$(shell pwd)/sysroot
  33. endif
  34. ifndef SYSROOT_OVERLAY
  35. SYSROOT_OVERLAY:=$(shell pwd)/sysroot-overlay
  36. endif
  37. SORTIX_BUILDS_DIR?=builds
  38. SORTIX_PORTS_DIR?=ports
  39. SORTIX_RELEASE_DIR?=release
  40. SORTIX_REPOSITORY_DIR?=repository
  41. SORTIX_ISO_COMPRESSION?=xz
  42. SORTIX_INCLUDE_SOURCE_GIT_REPO?=$(shell test -d .git && echo "file://`pwd`")
  43. SORTIX_INCLUDE_SOURCE_GIT_REPO:=$(SORTIX_INCLUDE_SOURCE_GIT_REPO)
  44. SORTIX_INCLUDE_SOURCE_GIT_ORIGIN?=
  45. SORTIX_INCLUDE_SOURCE_GIT_CLONE_OPTIONS?=--single-branch
  46. SORTIX_INCLUDE_SOURCE_GIT_BRANCHES?=master
  47. ifneq ($(and $(shell which git 2>/dev/null),$(SORTIX_INCLUDE_SOURCE_GIT_REPO)),)
  48. SORTIX_INCLUDE_SOURCE?=git
  49. else
  50. SORTIX_INCLUDE_SOURCE?=yes
  51. endif
  52. include build-aux/dirs.mak
  53. BUILD_NAME:=sortix-$(VERSION)-$(MACHINE)
  54. LIVE_INITRD:=$(SORTIX_BUILDS_DIR)/$(BUILD_NAME).live.initrd
  55. OVERLAY_INITRD:=$(SORTIX_BUILDS_DIR)/$(BUILD_NAME).overlay.initrd
  56. SRC_INITRD:=$(SORTIX_BUILDS_DIR)/$(BUILD_NAME).src.initrd
  57. SYSTEM_INITRD:=$(SORTIX_BUILDS_DIR)/$(BUILD_NAME).system.initrd
  58. .PHONY: all
  59. all: sysroot
  60. .PHONY: sysmerge
  61. sysmerge: sysroot
  62. sysmerge "$(SYSROOT)"
  63. .PHONY: sysmerge-wait
  64. sysmerge-wait: sysroot
  65. sysmerge --wait "$(SYSROOT)"
  66. .PHONY: clean-build-tools
  67. clean-build-tools:
  68. $(MAKE) -C carray clean
  69. $(MAKE) -C kblayout-compiler clean
  70. $(MAKE) -C mkinitrd clean
  71. $(MAKE) -C sf clean
  72. $(MAKE) -C tix clean
  73. .PHONY: build-tools
  74. build-tools:
  75. $(MAKE) -C carray
  76. $(MAKE) -C kblayout-compiler
  77. $(MAKE) -C mkinitrd
  78. $(MAKE) -C sf
  79. $(MAKE) -C tix
  80. .PHONY: install-build-tools
  81. install-build-tools:
  82. $(MAKE) -C carray install
  83. $(MAKE) -C kblayout-compiler install
  84. $(MAKE) -C mkinitrd install
  85. $(MAKE) -C sf install
  86. $(MAKE) -C tix install
  87. .PHONY: sysroot-fsh
  88. sysroot-fsh:
  89. mkdir -p "$(SYSROOT)"
  90. mkdir -p "$(SYSROOT)/bin"
  91. mkdir -p "$(SYSROOT)/boot"
  92. mkdir -p "$(SYSROOT)/dev"
  93. mkdir -p "$(SYSROOT)/etc"
  94. mkdir -p "$(SYSROOT)/etc/skel"
  95. mkdir -p "$(SYSROOT)/home"
  96. mkdir -p "$(SYSROOT)/include"
  97. mkdir -p "$(SYSROOT)/lib"
  98. mkdir -p "$(SYSROOT)/libexec"
  99. mkdir -p "$(SYSROOT)/mnt"
  100. mkdir -p "$(SYSROOT)/sbin"
  101. mkdir -p "$(SYSROOT)/share"
  102. mkdir -p "$(SYSROOT)/src"
  103. mkdir -p "$(SYSROOT)/tix"
  104. mkdir -p "$(SYSROOT)/tix/manifest"
  105. mkdir -p "$(SYSROOT)/tmp"
  106. mkdir -p "$(SYSROOT)/var"
  107. mkdir -p "$(SYSROOT)/var/empty"
  108. ln -sfT . "$(SYSROOT)/usr"
  109. .PHONY: sysroot-base-headers
  110. sysroot-base-headers: sysroot-fsh
  111. export SYSROOT="$(SYSROOT)" && \
  112. (for D in libc libm kernel; do ($(MAKE) -C $$D install-headers DESTDIR="$(SYSROOT)") || exit $$?; done)
  113. .PHONY: sysroot-system
  114. sysroot-system: sysroot-fsh sysroot-base-headers
  115. rm -f "$(SYSROOT)/tix/manifest/system"
  116. echo / >> "$(SYSROOT)/tix/manifest/system"
  117. echo /bin >> "$(SYSROOT)/tix/manifest/system"
  118. echo /boot >> "$(SYSROOT)/tix/manifest/system"
  119. echo /dev >> "$(SYSROOT)/tix/manifest/system"
  120. echo /etc >> "$(SYSROOT)/tix/manifest/system"
  121. echo /etc/skel >> "$(SYSROOT)/tix/manifest/system"
  122. echo /home >> "$(SYSROOT)/tix/manifest/system"
  123. echo /include >> "$(SYSROOT)/tix/manifest/system"
  124. echo /lib >> "$(SYSROOT)/tix/manifest/system"
  125. echo /libexec >> "$(SYSROOT)/tix/manifest/system"
  126. echo /mnt >> "$(SYSROOT)/tix/manifest/system"
  127. echo /sbin >> "$(SYSROOT)/tix/manifest/system"
  128. echo /share >> "$(SYSROOT)/tix/manifest/system"
  129. echo /src >> "$(SYSROOT)/tix/manifest/system"
  130. echo /tix >> "$(SYSROOT)/tix/manifest/system"
  131. echo /tix/manifest >> "$(SYSROOT)/tix/manifest/system"
  132. echo /tmp >> "$(SYSROOT)/tix/manifest/system"
  133. echo /usr >> "$(SYSROOT)/tix/manifest/system"
  134. echo /var >> "$(SYSROOT)/tix/manifest/system"
  135. echo /var/empty >> "$(SYSROOT)/tix/manifest/system"
  136. echo "$(HOST_MACHINE)" > "$(SYSROOT)/etc/machine"
  137. echo /etc/machine >> "$(SYSROOT)/tix/manifest/system"
  138. (echo 'NAME="Sortix"' && \
  139. echo 'VERSION="$(VERSION)"' && \
  140. echo 'ID=sortix' && \
  141. echo 'VERSION_ID="$(VERSION)"' && \
  142. echo 'PRETTY_NAME="Sortix $(VERSION)"' && \
  143. echo 'SORTIX_ABI=0.0' && \
  144. true) > "$(SYSROOT)/etc/sortix-release"
  145. echo /etc/sortix-release >> "$(SYSROOT)/tix/manifest/system"
  146. ln -sf sortix-release "$(SYSROOT)/etc/os-release"
  147. echo /etc/os-release >> "$(SYSROOT)/tix/manifest/system"
  148. find share | sed -e 's,^,/,' >> "$(SYSROOT)/tix/manifest/system"
  149. cp -RT share "$(SYSROOT)/share"
  150. export SYSROOT="$(SYSROOT)" && \
  151. (for D in $(MODULES); \
  152. do ($(MAKE) -C $$D && \
  153. rm -rf "$(SYSROOT).destdir" && \
  154. mkdir -p "$(SYSROOT).destdir" && \
  155. $(MAKE) -C $$D install DESTDIR="$(SYSROOT).destdir" && \
  156. (cd "$(SYSROOT).destdir" && find .) | sed -e 's/\.//' -e 's/^$$/\//' | \
  157. grep -E '^.+$$' >> "$(SYSROOT)/tix/manifest/system" && \
  158. cp -RT "$(SYSROOT).destdir" "$(SYSROOT)" && \
  159. rm -rf "$(SYSROOT).destdir") \
  160. || exit $$?; done)
  161. LC_ALL=C sort -u "$(SYSROOT)/tix/manifest/system" > "$(SYSROOT)/tix/manifest/system.new"
  162. mv "$(SYSROOT)/tix/manifest/system.new" "$(SYSROOT)/tix/manifest/system"
  163. .PHONY: sysroot-source
  164. sysroot-source: sysroot-fsh
  165. ifeq ($(SORTIX_INCLUDE_SOURCE),git)
  166. rm -rf "$(SYSROOT)/src"
  167. git clone --no-hardlinks $(SORTIX_INCLUDE_SOURCE_GIT_CLONE_OPTIONS) -- $(SORTIX_INCLUDE_SOURCE_GIT_REPO) "$(SYSROOT)/src"
  168. -cd "$(SYSROOT)/src" && for BRANCH in $(SORTIX_INCLUDE_SOURCE_GIT_BRANCHES); do \
  169. git fetch origin $$BRANCH && \
  170. (git branch -f $$BRANCH FETCH_HEAD || true) ; \
  171. done
  172. ifneq ($(SORTIX_INCLUDE_SOURCE_GIT_ORIGIN),)
  173. cd "$(SYSROOT)/src" && git remote set-url origin $(SORTIX_INCLUDE_SOURCE_GIT_ORIGIN)
  174. else
  175. -cd "$(SYSROOT)/src" && git remote rm origin
  176. endif
  177. else ifneq ($(SORTIX_INCLUDE_SOURCE),no)
  178. cp .gitignore -t "$(SYSROOT)/src"
  179. cp LICENSE -t "$(SYSROOT)/src"
  180. cp Makefile -t "$(SYSROOT)/src"
  181. cp README -t "$(SYSROOT)/src"
  182. cp -RT build-aux "$(SYSROOT)/src/build-aux"
  183. cp -RT share "$(SYSROOT)/src/share"
  184. (for D in $(MODULES); do (cp -R $$D -t "$(SYSROOT)/src" && $(MAKE) -C "$(SYSROOT)/src/$$D" clean) || exit $$?; done)
  185. endif
  186. (cd "$(SYSROOT)" && find .) | sed 's/\.//' | \
  187. grep -E '^/src(/.*)?$$' | \
  188. LC_ALL=C sort > "$(SYSROOT)/tix/manifest/src"
  189. .PHONY: sysroot-ports
  190. sysroot-ports: sysroot-fsh sysroot-base-headers sysroot-system sysroot-source
  191. @SORTIX_PORTS_DIR="$(SORTIX_PORTS_DIR)" \
  192. SORTIX_REPOSITORY_DIR="$(SORTIX_REPOSITORY_DIR)" \
  193. SYSROOT="$(SYSROOT)" \
  194. HOST="$(HOST)" \
  195. MAKE="$(MAKE)" \
  196. MAKEFLAGS="$(MAKEFLAGS)" \
  197. build-aux/build-ports.sh
  198. .PHONY: sysroot
  199. sysroot: sysroot-system sysroot-source sysroot-ports
  200. $(SORTIX_REPOSITORY_DIR):
  201. mkdir -p $@
  202. $(SORTIX_REPOSITORY_DIR)/$(HOST): $(SORTIX_REPOSITORY_DIR)
  203. mkdir -p $@
  204. .PHONY: clean-core
  205. clean-core:
  206. (for D in $(MODULES); do $(MAKE) clean -C $$D || exit $$?; done)
  207. .PHONY: clean-ports
  208. clean-ports:
  209. @SORTIX_PORTS_DIR="$(SORTIX_PORTS_DIR)" \
  210. HOST="$(HOST)" \
  211. MAKE="$(MAKE)" \
  212. MAKEFLAGS="$(MAKEFLAGS)" \
  213. build-aux/clean-ports.sh
  214. .PHONY: clean-builds
  215. clean-builds:
  216. rm -rf "$(SORTIX_BUILDS_DIR)"
  217. rm -f sortix.iso
  218. .PHONY: clean-release
  219. clean-release:
  220. rm -rf "$(SORTIX_RELEASE_DIR)"
  221. .PHONY: clean-repository
  222. clean-repository:
  223. rm -rf "$(SORTIX_REPOSITORY_DIR)"
  224. .PHONY: clean-sysroot
  225. clean-sysroot:
  226. rm -rf "$(SYSROOT)"
  227. rm -rf "$(SYSROOT)".destdir
  228. .PHONY: clean
  229. clean: clean-core clean-ports
  230. .PHONY: mostlyclean
  231. mostlyclean: clean-core clean-ports clean-builds clean-release clean-sysroot
  232. .PHONY: distclean
  233. distclean: clean-core clean-ports clean-builds clean-release clean-repository clean-sysroot
  234. .PHONY: most-things
  235. most-things: sysroot iso
  236. .PHONY: everything
  237. everything: most-things
  238. # Targets that build multiple architectures.
  239. .PHONY: sysroot-base-headers-all-archs
  240. sysroot-base-headers-all-archs:
  241. $(MAKE) clean clean-sysroot
  242. $(MAKE) sysroot-base-headers HOST=i686-sortix
  243. $(MAKE) clean clean-sysroot
  244. $(MAKE) sysroot-base-headers HOST=x86_64-sortix
  245. .PHONY: all-archs
  246. all-archs:
  247. $(MAKE) clean clean-sysroot
  248. $(MAKE) all HOST=i686-sortix
  249. $(MAKE) clean clean-sysroot
  250. $(MAKE) all HOST=x86_64-sortix
  251. .PHONY: most-things-all-archs
  252. most-things-all-archs:
  253. $(MAKE) clean clean-sysroot
  254. $(MAKE) most-things HOST=i686-sortix
  255. $(MAKE) clean clean-sysroot
  256. $(MAKE) most-things HOST=x86_64-sortix
  257. .PHONY: everything-all-archs
  258. everything-all-archs:
  259. $(MAKE) clean clean-sysroot
  260. $(MAKE) everything HOST=i686-sortix
  261. $(MAKE) clean clean-sysroot
  262. $(MAKE) everything HOST=x86_64-sortix
  263. .PHONY: release-all-archs
  264. release-all-archs:
  265. $(MAKE) clean clean-sysroot
  266. $(MAKE) release HOST=i686-sortix
  267. $(MAKE) clean clean-sysroot
  268. $(MAKE) release HOST=x86_64-sortix
  269. # Initial ramdisk
  270. $(LIVE_INITRD): sysroot
  271. mkdir -p `dirname $(LIVE_INITRD)`
  272. rm -rf $(LIVE_INITRD).d
  273. mkdir -p $(LIVE_INITRD).d
  274. mkdir -p $(LIVE_INITRD).d/etc
  275. mkdir -p $(LIVE_INITRD).d/etc/init
  276. echo single-user > $(LIVE_INITRD).d/etc/init/target
  277. echo "root::0:0:root:/root:sh" > $(LIVE_INITRD).d/etc/passwd
  278. echo "root::0:root" > $(LIVE_INITRD).d/etc/group
  279. mkdir -p $(LIVE_INITRD).d/home
  280. mkdir -p $(LIVE_INITRD).d/root -m 700
  281. cp -RT "$(SYSROOT)/etc/skel" $(LIVE_INITRD).d/root
  282. cp doc/welcome $(LIVE_INITRD).d/root
  283. tix-collection $(LIVE_INITRD).d create --platform=$(HOST) --prefix= --generation=2
  284. mkinitrd --format=sortix-initrd-2 $(LIVE_INITRD).d -o $(LIVE_INITRD)
  285. rm -rf $(LIVE_INITRD).d
  286. .PHONY: $(OVERLAY_INITRD)
  287. $(OVERLAY_INITRD): sysroot
  288. test ! -d "$(SYSROOT_OVERLAY)" || \
  289. mkinitrd --format=sortix-initrd-2 "$(SYSROOT_OVERLAY)" -o $(OVERLAY_INITRD)
  290. $(SRC_INITRD): sysroot
  291. mkinitrd --format=sortix-initrd-2 --manifest="$(SYSROOT)/tix/manifest/src" "$(SYSROOT)" -o $(SRC_INITRD)
  292. $(SYSTEM_INITRD): sysroot
  293. mkinitrd --format=sortix-initrd-2 --manifest="$(SYSROOT)/tix/manifest/system" "$(SYSROOT)" -o $(SYSTEM_INITRD)
  294. # Packaging
  295. $(SORTIX_BUILDS_DIR):
  296. mkdir -p $(SORTIX_BUILDS_DIR)
  297. # Bootable images
  298. $(SORTIX_BUILDS_DIR)/$(BUILD_NAME).iso: sysroot $(LIVE_INITRD) $(OVERLAY_INITRD) $(SRC_INITRD) $(SYSTEM_INITRD) $(SORTIX_BUILDS_DIR)
  299. rm -rf $(SORTIX_BUILDS_DIR)/$(BUILD_NAME)-iso
  300. mkdir -p $(SORTIX_BUILDS_DIR)/$(BUILD_NAME)-iso
  301. mkdir -p $(SORTIX_BUILDS_DIR)/$(BUILD_NAME)-iso/boot
  302. mkdir -p $(SORTIX_BUILDS_DIR)/$(BUILD_NAME)-iso/repository
  303. SORTIX_PORTS_DIR="$(SORTIX_PORTS_DIR)" \
  304. SORTIX_REPOSITORY_DIR="$(SORTIX_REPOSITORY_DIR)" \
  305. SYSROOT="$(SYSROOT)" \
  306. HOST="$(HOST)" \
  307. build-aux/iso-repository.sh $(SORTIX_BUILDS_DIR)/$(BUILD_NAME)-iso/repository
  308. ifeq ($(SORTIX_ISO_COMPRESSION),xz)
  309. xz -c "$(SYSROOT)/boot/sortix.bin" > $(SORTIX_BUILDS_DIR)/$(BUILD_NAME)-iso/boot/sortix.bin.xz
  310. xz -c $(LIVE_INITRD) > $(SORTIX_BUILDS_DIR)/$(BUILD_NAME)-iso/boot/live.initrd.xz
  311. test ! -e "$(OVERLAY_INITRD)" || \
  312. xz -c $(OVERLAY_INITRD) > $(SORTIX_BUILDS_DIR)/$(BUILD_NAME)-iso/boot/overlay.initrd.xz
  313. xz -c $(SRC_INITRD) > $(SORTIX_BUILDS_DIR)/$(BUILD_NAME)-iso/boot/src.initrd.xz
  314. xz -c $(SYSTEM_INITRD) > $(SORTIX_BUILDS_DIR)/$(BUILD_NAME)-iso/boot/system.initrd.xz
  315. build-aux/iso-grub-cfg.sh --platform $(HOST) --version $(VERSION) $(SORTIX_BUILDS_DIR)/$(BUILD_NAME)-iso
  316. grub-mkrescue --compress=xz -o $(SORTIX_BUILDS_DIR)/$(BUILD_NAME).iso $(SORTIX_BUILDS_DIR)/$(BUILD_NAME)-iso
  317. else ifeq ($(SORTIX_ISO_COMPRESSION),gzip)
  318. gzip -c "$(SYSROOT)/boot/sortix.bin" > $(SORTIX_BUILDS_DIR)/$(BUILD_NAME)-iso/boot/sortix.bin.gz
  319. gzip -c $(LIVE_INITRD) > $(SORTIX_BUILDS_DIR)/$(BUILD_NAME)-iso/boot/live.initrd.gz
  320. test ! -e "$(OVERLAY_INITRD)" || \
  321. gzip -c $(OVERLAY_INITRD) > $(SORTIX_BUILDS_DIR)/$(BUILD_NAME)-iso/boot/overlay.initrd.gz
  322. gzip -c $(SRC_INITRD) > $(SORTIX_BUILDS_DIR)/$(BUILD_NAME)-iso/boot/src.initrd.gz
  323. gzip -c $(SYSTEM_INITRD) > $(SORTIX_BUILDS_DIR)/$(BUILD_NAME)-iso/boot/system.initrd.gz
  324. build-aux/iso-grub-cfg.sh --platform $(HOST) --version $(VERSION) $(SORTIX_BUILDS_DIR)/$(BUILD_NAME)-iso
  325. grub-mkrescue --compress=gz -o $(SORTIX_BUILDS_DIR)/$(BUILD_NAME).iso $(SORTIX_BUILDS_DIR)/$(BUILD_NAME)-iso
  326. else # none
  327. cp "$(SYSROOT)/boot/sortix.bin" $(SORTIX_BUILDS_DIR)/$(BUILD_NAME)-iso/boot/sortix.bin
  328. cp $(LIVE_INITRD) $(SORTIX_BUILDS_DIR)/$(BUILD_NAME)-iso/boot/live.initrd
  329. test ! -e "$(OVERLAY_INITRD)" || \
  330. cp $(OVERLAY_INITRD) $(SORTIX_BUILDS_DIR)/$(BUILD_NAME)-iso/boot/overlay.initrd
  331. cp $(SRC_INITRD) $(SORTIX_BUILDS_DIR)/$(BUILD_NAME)-iso/boot/src.initrd
  332. cp $(SYSTEM_INITRD) $(SORTIX_BUILDS_DIR)/$(BUILD_NAME)-iso/boot/system.initrd
  333. build-aux/iso-grub-cfg.sh --platform $(HOST) --version $(VERSION) $(SORTIX_BUILDS_DIR)/$(BUILD_NAME)-iso
  334. grub-mkrescue -o $(SORTIX_BUILDS_DIR)/$(BUILD_NAME).iso $(SORTIX_BUILDS_DIR)/$(BUILD_NAME)-iso
  335. endif
  336. rm -rf $(SORTIX_BUILDS_DIR)/$(BUILD_NAME)-iso
  337. .PHONY: iso
  338. iso: $(SORTIX_BUILDS_DIR)/$(BUILD_NAME).iso
  339. sortix.iso: $(SORTIX_BUILDS_DIR)/$(BUILD_NAME).iso
  340. cp $< $@
  341. # Release
  342. $(SORTIX_RELEASE_DIR)/$(VERSION):
  343. mkdir -p $@
  344. $(SORTIX_RELEASE_DIR)/$(VERSION)/builds: $(SORTIX_RELEASE_DIR)/$(VERSION)
  345. mkdir -p $@
  346. $(SORTIX_RELEASE_DIR)/$(VERSION)/builds/$(BUILD_NAME).iso: $(SORTIX_BUILDS_DIR)/$(BUILD_NAME).iso $(SORTIX_RELEASE_DIR)/$(VERSION)/builds
  347. cp $< $@
  348. .PHONY: release-iso
  349. release-iso: $(SORTIX_RELEASE_DIR)/$(VERSION)/builds/$(BUILD_NAME).iso
  350. .PHONY: release-builds
  351. release-builds: release-iso
  352. $(SORTIX_RELEASE_DIR)/$(VERSION)/README: README $(SORTIX_RELEASE_DIR)/$(VERSION)
  353. cp $< $@
  354. .PHONY: release-readme
  355. release-readme: $(SORTIX_RELEASE_DIR)/$(VERSION)/README
  356. .PHONY: release-arch
  357. release-arch: release-builds release-readme
  358. .PHONY: release-shared
  359. release-shared: release-readme
  360. .PHONY: release
  361. release: release-arch release-shared
  362. # Virtualization
  363. .PHONY: run-virtualbox
  364. run-virtualbox: sortix.iso
  365. virtualbox --startvm sortix
  366. .PHONY: run-virtualbox-debug
  367. run-virtualbox-debug: sortix.iso
  368. virtualbox --debug --start-running --startvm sortix
  369. # Statistics
  370. .PHONY: linecount
  371. linecount:
  372. wc -l `find . -type f | grep -E '\.(h|h\+\+|c|cpp|c\+\+|s|S|asm|kblayout|mak|sh)$$|(^|/)Makefile$$' | grep -Ev '^\./(\.git|sysroot|sysroot-overlay|ports|repository)(/|$$)'` | sort -n