2013-03-19 18:28:32 -04:00
|
|
|
SOFTWARE_MEANT_FOR_SORTIX=1
|
|
|
|
MAKEFILE_NOT_MEANT_FOR_SORTIX=1
|
2012-09-10 17:36:15 -04:00
|
|
|
include compiler.mak
|
|
|
|
include version.mak
|
|
|
|
|
2013-12-26 19:44:03 -05:00
|
|
|
MODULES=doc libc libm dispd games mkinitrd utils bench ext mbr kernel
|
2011-12-02 16:48:30 -05:00
|
|
|
|
2011-09-15 16:38:40 -04:00
|
|
|
ifndef SYSROOT
|
2012-09-10 17:36:15 -04:00
|
|
|
SYSROOT:=$(shell pwd)/sysroot
|
2013-03-19 18:28:32 -04:00
|
|
|
SUBMAKE_OPTIONS:=$(SUBMAKE_OPTIONS) "SYSROOT=$(SYSROOT)"
|
2012-09-10 17:36:15 -04:00
|
|
|
endif
|
|
|
|
|
2013-03-19 18:28:32 -04:00
|
|
|
ifndef SYSROOT_OVERLAY
|
|
|
|
SYSROOT_OVERLAY:=$(shell pwd)/sysroot-overlay
|
|
|
|
SUBMAKE_OPTIONS:=$(SUBMAKE_OPTIONS) "SYSROOT_OVERLAY=$(SYSROOT_OVERLAY)"
|
2011-08-05 08:25:00 -04:00
|
|
|
endif
|
|
|
|
|
2013-03-19 18:28:32 -04:00
|
|
|
SORTIX_BUILDS_DIR?=builds
|
2013-10-30 07:09:57 -04:00
|
|
|
SORTIX_PORTS_DIR?=ports
|
2013-03-19 18:28:32 -04:00
|
|
|
SORTIX_RELEASE_DIR?=release
|
2013-10-30 07:09:57 -04:00
|
|
|
SORTIX_REPOSITORY_DIR?=repository
|
2013-03-19 18:28:32 -04:00
|
|
|
|
2012-09-10 17:36:15 -04:00
|
|
|
include dirs.mak
|
2011-08-05 08:25:00 -04:00
|
|
|
|
2013-03-19 18:28:32 -04:00
|
|
|
BUILD_NAME:=sortix_$(VERSION)_$(MACHINE)
|
|
|
|
DEBNAME:=sortix_$(VERSION)_$(MACHINE)
|
2011-08-05 08:25:00 -04:00
|
|
|
|
2013-03-19 18:28:32 -04:00
|
|
|
INITRD:=$(SORTIX_BUILDS_DIR)/$(BUILD_NAME).initrd
|
2012-03-07 12:04:59 -05:00
|
|
|
|
2013-03-19 18:28:32 -04:00
|
|
|
SUBMAKE_OPTIONS:=$(SUBMAKE_OPTIONS) VERSION=$(VERSION) PREFIX= EXEC_PREFIX=/$(HOST)
|
2011-09-08 05:10:41 -04:00
|
|
|
|
2013-03-19 18:28:32 -04:00
|
|
|
.PHONY: all
|
|
|
|
all: sysroot
|
2011-09-07 06:19:17 -04:00
|
|
|
|
2013-03-19 18:28:32 -04:00
|
|
|
.PHONY: build-tools
|
|
|
|
build-tools:
|
|
|
|
$(MAKE) -C mkinitrd
|
2013-03-26 07:40:43 -04:00
|
|
|
$(MAKE) -C tix
|
2012-09-10 15:45:38 -04:00
|
|
|
|
2013-03-19 18:28:32 -04:00
|
|
|
.PHONY: install-build-tools
|
|
|
|
install-build-tools:
|
|
|
|
$(MAKE) -C mkinitrd install
|
2013-03-26 07:40:43 -04:00
|
|
|
$(MAKE) -C tix install
|
2012-09-10 17:36:15 -04:00
|
|
|
|
2013-03-19 18:28:32 -04:00
|
|
|
.PHONY: sysroot-fsh
|
2012-09-10 17:36:15 -04:00
|
|
|
sysroot-fsh:
|
|
|
|
mkdir -p "$(SYSROOT)"
|
2013-03-19 18:28:32 -04:00
|
|
|
for DIRNAME in boot etc include; do (\
|
2012-09-10 17:36:15 -04:00
|
|
|
mkdir -p "$(SYSROOT)/$$DIRNAME" &&\
|
|
|
|
mkdir -p "$(SYSROOT)/$$DIRNAME/$(HOST)" \
|
|
|
|
) || exit $$?; done;
|
2013-03-19 18:28:32 -04:00
|
|
|
mkdir -p "$(SYSROOT)/$(HOST)"
|
|
|
|
for DIRNAME in bin lib; do (\
|
|
|
|
mkdir -p "$(SYSROOT)/$(HOST)/$$DIRNAME" \
|
|
|
|
) || exit $$?; done;
|
|
|
|
mkdir -p "$(SYSROOT)/etc/skel"
|
|
|
|
mkdir -p "$(SYSROOT)/home"
|
|
|
|
mkdir -p "$(SYSROOT)/mnt"
|
|
|
|
mkdir -p "$(SYSROOT)/share"
|
|
|
|
mkdir -p "$(SYSROOT)/src"
|
|
|
|
mkdir -p "$(SYSROOT)/tmp"
|
2013-10-01 14:21:50 -04:00
|
|
|
echo "root::0:0:root:/root:sh" > "$(SYSROOT)/etc/passwd"
|
2013-10-01 16:23:50 -04:00
|
|
|
echo "root::0:root" > "$(SYSROOT)/etc/group"
|
2013-03-19 18:28:32 -04:00
|
|
|
|
|
|
|
.PHONY: sysroot-base-headers
|
|
|
|
sysroot-base-headers: sysroot-fsh
|
2013-12-19 19:24:47 -05:00
|
|
|
(for D in libc libm kernel; do ($(MAKE) -C $$D install-headers $(SUBMAKE_OPTIONS) DESTDIR="$(SYSROOT)") || exit $$?; done)
|
2013-03-19 18:28:32 -04:00
|
|
|
|
|
|
|
.PHONY: sysroot-system
|
|
|
|
sysroot-system: sysroot-fsh sysroot-base-headers
|
|
|
|
(for D in $(MODULES); do ($(MAKE) -C $$D $(SUBMAKE_OPTIONS) && $(MAKE) -C $$D install $(SUBMAKE_OPTIONS) DESTDIR="$(SYSROOT)") || exit $$?; done)
|
|
|
|
|
|
|
|
.PHONY: sysroot-source
|
|
|
|
sysroot-source: sysroot-fsh
|
|
|
|
cp compiler.mak -t "$(SYSROOT)/src"
|
|
|
|
cp dirs.mak -t "$(SYSROOT)/src"
|
|
|
|
cp platform.mak -t "$(SYSROOT)/src"
|
|
|
|
cp version.mak -t "$(SYSROOT)/src"
|
2013-10-20 10:50:48 -04:00
|
|
|
cp COPYING-GPL -t "$(SYSROOT)/src"
|
|
|
|
cp COPYING-LGPL -t "$(SYSROOT)/src"
|
2013-03-19 18:28:32 -04:00
|
|
|
cp README -t "$(SYSROOT)/src"
|
|
|
|
(for D in $(MODULES); do (cp -LR $$D -t "$(SYSROOT)/src" && $(MAKE) -C "$(SYSROOT)/src/$$D" clean) || exit $$?; done)
|
2013-03-19 18:15:12 -04:00
|
|
|
cp -LR system -t "$(SYSROOT)/src"
|
2013-03-19 18:28:32 -04:00
|
|
|
|
2013-10-30 07:09:57 -04:00
|
|
|
.PHONY: sysroot-ports
|
|
|
|
sysroot-ports: sysroot-fsh sysroot-base-headers sysroot-system sysroot-source
|
|
|
|
@SORTIX_PORTS_DIR="$(SORTIX_PORTS_DIR)" \
|
|
|
|
SORTIX_REPOSITORY_DIR="$(SORTIX_REPOSITORY_DIR)" \
|
|
|
|
SYSROOT="$(SYSROOT)" \
|
|
|
|
HOST="$(HOST)" \
|
|
|
|
MAKE="$(MAKE)" \
|
|
|
|
MAKEFLAGS="$(MAKEFLAGS) $(SUBMAKE_OPTIONS)" \
|
|
|
|
./build-ports.sh
|
|
|
|
|
2013-03-19 18:28:32 -04:00
|
|
|
.PHONY: sysroot-overlay
|
2013-10-30 07:09:57 -04:00
|
|
|
sysroot-overlay: sysroot-fsh sysroot-system sysroot-ports
|
2013-03-19 18:28:32 -04:00
|
|
|
! [ -d "$(SYSROOT_OVERLAY)" ] || \
|
|
|
|
cp -R --preserve=mode,timestamp,links "$(SYSROOT_OVERLAY)" -T "$(SYSROOT)"
|
|
|
|
|
|
|
|
.PHONY: sysroot-user-skel
|
2013-10-30 07:09:57 -04:00
|
|
|
sysroot-user-skel: sysroot-fsh sysroot-system sysroot-ports sysroot-overlay
|
2012-12-21 15:22:09 -05:00
|
|
|
cp "$(SYSROOT)/share/doc/welcome" -t "$(SYSROOT)/etc/skel"
|
2013-03-19 18:28:32 -04:00
|
|
|
|
|
|
|
.PHONY: sysroot-home-directory
|
2013-10-30 07:09:57 -04:00
|
|
|
sysroot-home-directory: sysroot-fsh sysroot-system sysroot-ports sysroot-overlay sysroot-user-skel
|
2013-03-19 18:28:32 -04:00
|
|
|
mkdir -p "$(SYSROOT)/root"
|
|
|
|
cp -R "$(SYSROOT)/etc/skel" -T "$(SYSROOT)/root"
|
|
|
|
|
|
|
|
.PHONY: sysroot
|
2013-10-30 07:09:57 -04:00
|
|
|
sysroot: sysroot-system sysroot-source sysroot-ports sysroot-overlay sysroot-home-directory
|
|
|
|
|
|
|
|
$(SORTIX_REPOSITORY_DIR):
|
|
|
|
mkdir -p $@
|
|
|
|
|
|
|
|
$(SORTIX_REPOSITORY_DIR)/$(HOST): $(SORTIX_REPOSITORY_DIR)
|
|
|
|
mkdir -p $@
|
2013-03-19 18:28:32 -04:00
|
|
|
|
|
|
|
.PHONY: clean-core
|
|
|
|
clean-core:
|
2013-03-26 07:40:43 -04:00
|
|
|
(for D in $(MODULES) tix; do $(MAKE) clean $(SUBMAKE_OPTIONS) --directory $$D || exit $$?; done)
|
2013-03-19 18:28:32 -04:00
|
|
|
|
2013-10-30 07:09:57 -04:00
|
|
|
.PHONY: clean-ports
|
|
|
|
clean-ports:
|
|
|
|
@SORTIX_PORTS_DIR="$(SORTIX_PORTS_DIR)" \
|
|
|
|
HOST="$(HOST)" \
|
|
|
|
MAKE="$(MAKE)" \
|
|
|
|
MAKEFLAGS="$(MAKEFLAGS) $(SUBMAKE_OPTIONS)" \
|
|
|
|
./clean-ports.sh
|
|
|
|
|
2013-03-19 18:28:32 -04:00
|
|
|
.PHONY: clean-builds
|
2012-09-10 17:36:15 -04:00
|
|
|
clean-builds:
|
2013-03-19 18:28:32 -04:00
|
|
|
rm -rf "$(SORTIX_BUILDS_DIR)"
|
|
|
|
rm -f sortix.initrd
|
2011-08-05 08:25:00 -04:00
|
|
|
rm -f sortix.iso
|
2013-03-19 18:28:32 -04:00
|
|
|
rm -f sortix.iso.xz
|
|
|
|
|
|
|
|
.PHONY: clean-release
|
|
|
|
clean-release:
|
|
|
|
rm -rf "$(SORTIX_RELEASE_DIR)"
|
2011-08-05 08:25:00 -04:00
|
|
|
|
2013-10-30 07:09:57 -04:00
|
|
|
.PHONY: clean-repository
|
|
|
|
clean-repository:
|
|
|
|
rm -rf "$(SORTIX_REPOSITORY_DIR)"
|
|
|
|
|
2013-03-19 18:28:32 -04:00
|
|
|
.PHONY: clean-sysroot
|
2012-09-10 17:36:15 -04:00
|
|
|
clean-sysroot:
|
|
|
|
rm -rf "$(SYSROOT)"
|
|
|
|
|
2013-03-19 18:28:32 -04:00
|
|
|
.PHONY: clean
|
2013-10-30 07:09:57 -04:00
|
|
|
clean: clean-core clean-ports
|
2012-09-10 17:36:15 -04:00
|
|
|
|
2013-03-19 18:28:32 -04:00
|
|
|
.PHONY: mostlyclean
|
2013-10-30 07:09:57 -04:00
|
|
|
mostlyclean: clean-core clean-ports clean-builds clean-release clean-sysroot
|
2011-09-07 06:19:17 -04:00
|
|
|
|
2013-03-19 18:28:32 -04:00
|
|
|
.PHONY: distclean
|
2013-10-30 07:09:57 -04:00
|
|
|
distclean: clean-core clean-ports clean-builds clean-release clean-repository clean-sysroot
|
2013-03-19 18:28:32 -04:00
|
|
|
|
|
|
|
.PHONY: most-things
|
|
|
|
most-things: sysroot initrd deb tar iso
|
|
|
|
|
|
|
|
.PHONY: everything
|
|
|
|
everything: most-things iso.xz
|
2012-09-10 17:36:15 -04:00
|
|
|
|
2013-03-19 18:28:32 -04:00
|
|
|
# Targets that build multiple architectures.
|
|
|
|
|
|
|
|
.PHONY: all-archs
|
2012-09-10 17:36:15 -04:00
|
|
|
all-archs:
|
2013-03-19 18:28:32 -04:00
|
|
|
$(MAKE) clean
|
|
|
|
$(MAKE) all HOST=i486-sortix
|
|
|
|
$(MAKE) clean
|
|
|
|
$(MAKE) all HOST=x86_64-sortix
|
|
|
|
|
|
|
|
.PHONY: most-things-all-archs
|
|
|
|
most-things-all-archs:
|
|
|
|
$(MAKE) clean
|
|
|
|
$(MAKE) most-things HOST=i486-sortix
|
|
|
|
$(MAKE) clean
|
|
|
|
$(MAKE) most-things HOST=x86_64-sortix
|
|
|
|
|
|
|
|
.PHONY: everything-all-archs
|
|
|
|
everything-all-archs:
|
|
|
|
$(MAKE) clean
|
|
|
|
$(MAKE) everything HOST=i486-sortix
|
|
|
|
$(MAKE) clean
|
|
|
|
$(MAKE) everything HOST=x86_64-sortix
|
2011-12-02 16:56:50 -05:00
|
|
|
|
2013-03-19 18:28:32 -04:00
|
|
|
.PHONY: release-all-archs
|
|
|
|
release-all-archs:
|
|
|
|
$(MAKE) clean
|
|
|
|
$(MAKE) release HOST=i486-sortix
|
|
|
|
$(MAKE) clean
|
|
|
|
$(MAKE) release HOST=x86_64-sortix
|
2011-08-05 08:25:00 -04:00
|
|
|
|
2013-03-19 18:28:32 -04:00
|
|
|
# Initial ramdisk
|
|
|
|
|
|
|
|
$(INITRD): sysroot
|
|
|
|
mkdir -p `dirname $(INITRD)`
|
|
|
|
echo -n > $(INITRD).filter
|
2012-08-07 18:19:44 -04:00
|
|
|
echo "exclude /boot" >> $(INITRD).filter
|
|
|
|
echo "exclude /dev" >> $(INITRD).filter
|
|
|
|
echo "exclude /next" >> $(INITRD).filter
|
|
|
|
echo "exclude /tmp" >> $(INITRD).filter
|
|
|
|
for OTHER_PLATFORM in $(OTHER_PLATFORMS); do \
|
|
|
|
echo "exclude /$$OTHER_PLATFORM" >> $(INITRD).filter; \
|
|
|
|
echo "exclude /etc/$$OTHER_PLATFORM" >> $(INITRD).filter; \
|
|
|
|
echo "exclude /include/$$OTHER_PLATFORM" >> $(INITRD).filter; \
|
2013-10-30 07:09:57 -04:00
|
|
|
echo "exclude /tix/$$OTHER_PLATFORM" >> $(INITRD).filter; \
|
2012-08-07 18:19:44 -04:00
|
|
|
done;
|
2013-03-19 18:28:32 -04:00
|
|
|
if ! which mkinitrd; then echo You need to install mkinitrd; fi
|
2012-08-07 18:19:44 -04:00
|
|
|
mkinitrd --filter $(INITRD).filter "$(SYSROOT)" -o $(INITRD)
|
2013-03-19 18:28:32 -04:00
|
|
|
rm -f $(INITRD).filter
|
|
|
|
|
|
|
|
.PHONY: initrd
|
|
|
|
initrd: $(INITRD)
|
|
|
|
|
|
|
|
sortix.initrd: $(INITRD)
|
|
|
|
cp $(INITRD) sortix.initrd
|
2011-08-06 21:02:37 -04:00
|
|
|
|
2011-08-05 08:25:00 -04:00
|
|
|
# Local machine
|
|
|
|
|
2013-03-19 18:28:32 -04:00
|
|
|
.PHONY: install
|
|
|
|
install: sysroot initrd
|
|
|
|
cp "$(SYSROOT)/boot/$(HOST)/sortix.bin" /boot/sortix.initrd
|
|
|
|
cp $(INITRD) /boot/sortix.initrd
|
2011-08-05 08:25:00 -04:00
|
|
|
cp debsrc/etc/grub.d/42_sortix /etc/grub.d/42_sortix
|
|
|
|
chmod +x /etc/grub.d/42_sortix
|
|
|
|
update-grub
|
|
|
|
|
2013-03-19 18:28:32 -04:00
|
|
|
.PHONY: uninstall
|
2011-08-05 08:25:00 -04:00
|
|
|
uninstall:
|
|
|
|
rm -f /boot/sortix.bin
|
2013-03-19 18:28:32 -04:00
|
|
|
rm -f /boot/sortix.initrd
|
2011-08-05 08:25:00 -04:00
|
|
|
rm -f /etc/grub.d/42_sortix
|
|
|
|
|
|
|
|
# Packaging
|
|
|
|
|
2013-03-19 18:28:32 -04:00
|
|
|
$(SORTIX_BUILDS_DIR):
|
|
|
|
mkdir -p $(SORTIX_BUILDS_DIR)
|
|
|
|
|
|
|
|
$(SORTIX_BUILDS_DIR)/$(BUILD_NAME).tar.xz: sysroot $(INITRD) $(SORTIX_BUILDS_DIR)
|
|
|
|
rm -rf $(SORTIX_BUILDS_DIR)/tardir
|
|
|
|
mkdir -p $(SORTIX_BUILDS_DIR)/tardir
|
|
|
|
mkdir -p $(SORTIX_BUILDS_DIR)/tardir/boot
|
|
|
|
cp "$(SYSROOT)/boot/$(HOST)/sortix.bin" $(SORTIX_BUILDS_DIR)/tardir/boot/sortix.bin
|
|
|
|
cp $(INITRD) $(SORTIX_BUILDS_DIR)/tardir/boot/sortix.initrd
|
|
|
|
cp -R debsrc -T $(SORTIX_BUILDS_DIR)/tardir
|
|
|
|
rm -rf $(SORTIX_BUILDS_DIR)/tardir/DEBIAN
|
|
|
|
tar --create --xz --file $(SORTIX_BUILDS_DIR)/$(BUILD_NAME).tar.xz -C $(SORTIX_BUILDS_DIR)/tardir `ls $(SORTIX_BUILDS_DIR)/tardir`
|
|
|
|
rm -rf $(SORTIX_BUILDS_DIR)/tardir
|
|
|
|
|
|
|
|
.PHONY: tar
|
|
|
|
tar: $(SORTIX_BUILDS_DIR)/$(BUILD_NAME).tar.xz
|
|
|
|
|
|
|
|
$(SORTIX_BUILDS_DIR)/$(DEBNAME).deb: sysroot $(INITRD) $(SORTIX_BUILDS_DIR)
|
|
|
|
rm -rf $(SORTIX_BUILDS_DIR)/$(DEBNAME)
|
|
|
|
mkdir -p $(SORTIX_BUILDS_DIR)/$(DEBNAME)
|
|
|
|
mkdir -p $(SORTIX_BUILDS_DIR)/$(DEBNAME)/boot
|
|
|
|
cp "$(SYSROOT)/boot/$(HOST)/sortix.bin" $(SORTIX_BUILDS_DIR)/$(DEBNAME)/boot/sortix.bin
|
|
|
|
cp $(INITRD) $(SORTIX_BUILDS_DIR)/$(DEBNAME)/boot/sortix.initrd
|
|
|
|
expr \( `stat --printf="%s" $(SORTIX_BUILDS_DIR)/$(DEBNAME)/boot/sortix.bin` \
|
|
|
|
+ `stat --printf="%s" $(SORTIX_BUILDS_DIR)/$(DEBNAME)/boot/sortix.initrd` \
|
|
|
|
+ 1023 \) / 1024 > $(SORTIX_BUILDS_DIR)/$(DEBNAME)/boot/deb.size
|
|
|
|
cp -R debsrc -T $(SORTIX_BUILDS_DIR)/$(DEBNAME)
|
|
|
|
SIZE=`cat $(SORTIX_BUILDS_DIR)/$(DEBNAME)/boot/deb.size`; \
|
2011-08-05 08:25:00 -04:00
|
|
|
cat debsrc/DEBIAN/control | \
|
2013-03-19 18:28:32 -04:00
|
|
|
sed "s/SORTIX_PACKAGE_NAME/sortix/g" | \
|
2011-08-05 08:25:00 -04:00
|
|
|
sed "s/SORTIX_VERSION/$(VERSION)/g" | \
|
|
|
|
sed "s/SORTIX_ARCH/all/g" | \
|
2011-10-16 11:58:19 -04:00
|
|
|
sed "s/SORTIX_SIZE/$$SIZE/g" | \
|
2013-03-19 18:28:32 -04:00
|
|
|
cat > $(SORTIX_BUILDS_DIR)/$(DEBNAME)/DEBIAN/control
|
|
|
|
rm $(SORTIX_BUILDS_DIR)/$(DEBNAME)/boot/deb.size
|
|
|
|
dpkg --build $(SORTIX_BUILDS_DIR)/$(DEBNAME) $(SORTIX_BUILDS_DIR)/$(DEBNAME).deb
|
|
|
|
rm -rf $(SORTIX_BUILDS_DIR)/$(DEBNAME)/DEBIAN
|
|
|
|
rm -rf $(SORTIX_BUILDS_DIR)/$(DEBNAME)
|
|
|
|
|
|
|
|
.PHONY: deb
|
|
|
|
deb: $(SORTIX_BUILDS_DIR)/$(DEBNAME).deb
|
2011-08-05 08:25:00 -04:00
|
|
|
|
|
|
|
# Bootable images
|
|
|
|
|
2013-03-19 18:28:32 -04:00
|
|
|
$(SORTIX_BUILDS_DIR)/$(BUILD_NAME).iso: sysroot $(INITRD) $(SORTIX_BUILDS_DIR)
|
|
|
|
rm -rf $(SORTIX_BUILDS_DIR)/$(BUILD_NAME)-iso
|
|
|
|
mkdir -p $(SORTIX_BUILDS_DIR)/$(BUILD_NAME)-iso
|
|
|
|
cp -R isosrc -T $(SORTIX_BUILDS_DIR)/$(BUILD_NAME)-iso
|
|
|
|
cp "$(SYSROOT)/boot/$(HOST)/sortix.bin" $(SORTIX_BUILDS_DIR)/$(BUILD_NAME)-iso/boot/sortix.bin
|
|
|
|
cp $(INITRD) $(SORTIX_BUILDS_DIR)/$(BUILD_NAME)-iso/boot/sortix.initrd
|
|
|
|
grub-mkrescue -o $(SORTIX_BUILDS_DIR)/$(BUILD_NAME).iso $(SORTIX_BUILDS_DIR)/$(BUILD_NAME)-iso
|
|
|
|
rm -rf $(SORTIX_BUILDS_DIR)/$(BUILD_NAME)-iso
|
|
|
|
|
|
|
|
$(SORTIX_BUILDS_DIR)/$(BUILD_NAME).iso.xz: $(SORTIX_BUILDS_DIR)/$(BUILD_NAME).iso $(SORTIX_BUILDS_DIR)
|
|
|
|
xz -c $< > $@
|
|
|
|
|
|
|
|
.PHONY: iso
|
|
|
|
iso: $(SORTIX_BUILDS_DIR)/$(BUILD_NAME).iso
|
|
|
|
|
|
|
|
.PHONY: iso.xz
|
|
|
|
iso.xz: $(SORTIX_BUILDS_DIR)/$(BUILD_NAME).iso.xz
|
|
|
|
|
|
|
|
sortix.iso: $(SORTIX_BUILDS_DIR)/$(BUILD_NAME).iso
|
|
|
|
cp $(SORTIX_BUILDS_DIR)/$(BUILD_NAME).iso $@
|
|
|
|
|
|
|
|
sortix.iso.xz: $(SORTIX_BUILDS_DIR)/$(BUILD_NAME).iso.xz
|
|
|
|
cp $(SORTIX_BUILDS_DIR)/$(BUILD_NAME).iso.xz $@
|
|
|
|
|
|
|
|
# Release
|
|
|
|
|
|
|
|
$(SORTIX_RELEASE_DIR):
|
|
|
|
mkdir -p $@
|
|
|
|
|
|
|
|
$(SORTIX_RELEASE_DIR)/$(VERSION): $(SORTIX_RELEASE_DIR)
|
|
|
|
mkdir -p $@
|
2011-08-05 08:25:00 -04:00
|
|
|
|
2013-03-19 18:28:32 -04:00
|
|
|
$(SORTIX_RELEASE_DIR)/$(VERSION)/builds: $(SORTIX_RELEASE_DIR)/$(VERSION)
|
|
|
|
mkdir -p $@
|
2012-09-10 17:36:15 -04:00
|
|
|
|
2013-03-19 18:28:32 -04:00
|
|
|
$(SORTIX_RELEASE_DIR)/$(VERSION)/builds/$(BUILD_NAME).iso.xz: $(SORTIX_BUILDS_DIR)/$(BUILD_NAME).iso.xz $(SORTIX_RELEASE_DIR)/$(VERSION)/builds
|
|
|
|
cp $< $@
|
|
|
|
|
|
|
|
.PHONY: release-iso.xz
|
|
|
|
release-iso.xz: $(SORTIX_RELEASE_DIR)/$(VERSION)/builds/$(BUILD_NAME).iso.xz
|
|
|
|
|
|
|
|
$(SORTIX_RELEASE_DIR)/$(VERSION)/builds/$(DEBNAME).deb: $(SORTIX_BUILDS_DIR)/$(DEBNAME).deb $(SORTIX_RELEASE_DIR)/$(VERSION)/builds
|
|
|
|
cp $< $@
|
|
|
|
|
|
|
|
.PHONY: release-deb
|
|
|
|
release-deb: $(SORTIX_RELEASE_DIR)/$(VERSION)/builds/$(DEBNAME).deb
|
|
|
|
|
|
|
|
$(SORTIX_RELEASE_DIR)/$(VERSION)/builds/$(BUILD_NAME).tar.xz: $(SORTIX_BUILDS_DIR)/$(BUILD_NAME).tar.xz $(SORTIX_RELEASE_DIR)/$(VERSION)/builds
|
|
|
|
cp $< $@
|
|
|
|
|
|
|
|
.PHONY: release-tar
|
|
|
|
release-tar: $(SORTIX_RELEASE_DIR)/$(VERSION)/builds/$(BUILD_NAME).tar.xz
|
|
|
|
|
|
|
|
.PHONY: release-builds
|
|
|
|
release-builds: release-iso.xz release-deb release-tar
|
|
|
|
|
2012-12-21 15:22:09 -05:00
|
|
|
$(SORTIX_RELEASE_DIR)/$(VERSION)/doc: $(SORTIX_RELEASE_DIR)/$(VERSION) doc doc/*
|
|
|
|
cp -R doc -T $(SORTIX_RELEASE_DIR)/$(VERSION)/doc
|
|
|
|
rm -f $(SORTIX_RELEASE_DIR)/$(VERSION)/doc/.gitignore
|
|
|
|
rm -f $(SORTIX_RELEASE_DIR)/$(VERSION)/doc/Makefile
|
|
|
|
|
|
|
|
.PHONY: release-doc
|
|
|
|
release-doc: $(SORTIX_RELEASE_DIR)/$(VERSION)/doc
|
|
|
|
|
2013-03-19 18:28:32 -04:00
|
|
|
$(SORTIX_RELEASE_DIR)/$(VERSION)/README: README $(SORTIX_RELEASE_DIR)/$(VERSION)
|
|
|
|
cp $< $@
|
|
|
|
|
|
|
|
.PHONY: release-readme
|
|
|
|
release-readme: $(SORTIX_RELEASE_DIR)/$(VERSION)/README
|
|
|
|
|
2013-10-30 07:09:57 -04:00
|
|
|
$(SORTIX_RELEASE_DIR)/$(VERSION)/repository:
|
|
|
|
mkdir -p $@
|
|
|
|
|
|
|
|
$(SORTIX_RELEASE_DIR)/$(VERSION)/repository/$(HOST): sysroot $(SORTIX_REPOSITORY_DIR)/$(HOST) $(SORTIX_RELEASE_DIR)/$(VERSION)/repository
|
|
|
|
cp -R $(SORTIX_REPOSITORY_DIR)/$(HOST) -T $@
|
|
|
|
|
|
|
|
.PHONY: release-repository
|
|
|
|
release-repository: $(SORTIX_RELEASE_DIR)/$(VERSION)/repository/$(HOST)
|
|
|
|
|
2013-03-19 18:28:32 -04:00
|
|
|
.PHONY: release-arch
|
2013-10-30 07:09:57 -04:00
|
|
|
release-arch: release-builds release-doc release-readme release-repository
|
2013-03-19 18:28:32 -04:00
|
|
|
|
|
|
|
.PHONY: release-shared
|
2012-12-21 15:22:09 -05:00
|
|
|
release-shared: release-doc release-readme
|
2013-03-19 18:28:32 -04:00
|
|
|
|
|
|
|
.PHONY: release
|
|
|
|
release: release-arch release-shared
|
2011-08-05 08:25:00 -04:00
|
|
|
|
|
|
|
# Virtualization
|
2013-03-19 18:28:32 -04:00
|
|
|
.PHONY: run-virtualbox
|
2011-08-05 08:25:00 -04:00
|
|
|
run-virtualbox: sortix.iso
|
|
|
|
virtualbox --startvm sortix
|
|
|
|
|
2013-03-19 18:28:32 -04:00
|
|
|
.PHONY: run-virtualbox-debug
|
2011-08-05 08:25:00 -04:00
|
|
|
run-virtualbox-debug: sortix.iso
|
|
|
|
virtualbox --debug --start-running --startvm sortix
|
|
|
|
|
2013-03-19 18:28:32 -04:00
|
|
|
# Statistics
|
|
|
|
.PHONY: linecount
|
|
|
|
linecount:
|
2013-10-30 07:09:57 -04:00
|
|
|
wc -l `find | grep -E '\.h$$|\.h\+\+$$|\.c$$|\.cpp$$|\.c\+\+$$|\.s$$|\.S$$|\.asm$$|Makefile$$' | grep -v sysroot | grep -v sysroot-overlay | grep -v ports` | sort -n
|