summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile77
1 files changed, 22 insertions, 55 deletions
diff --git a/Makefile b/Makefile
index d66b8ba..24b4834 100644
--- a/Makefile
+++ b/Makefile
@@ -1,69 +1,36 @@
+# Copyright (C) 2025 Danny Holman <dholman@gymli.org>
+#
+# This file is part of BoxOS, a free and open-source Unix-like operating
+# system.
+#
+# BoxOS is free software; you can redistribute it and/or modify under the
+# terms of the GNU General Public License as published by the Free Software
+# Foundation; either version 2 of the License, or (at your option) any later
+# version.
+#
+# BoxOS is distributed in the hope it will be useful, but WITHOUT ANY WARRANTY;
+# without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE. See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along with
+# BoxOS; if not, see <https://www.gnu.org/licenses/>.
+
VERSION:=$(shell git describe --abbrev=4 --dirty --always --tags)
ROOTDIR:=$(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))/
-SYS_INCLUDE:=-I$(ROOTDIR)include
+
include build.conf
-export ARCH VERSION ROOTDIR DESTDIR SYS_INCLUDE CC LD
+VERSION:=$(addsuffix $(LOCAL_VER), $(VERSION))
+export VERSION ROOTDIR DESTDIR
SUBDIRS:=bootstrap \
- kernel \
-.PHONY: all clean modules install install-headers $(SUBDIRS)
+.PHONY: all clean install $(SUBDIRS)
all: $(SUBDIRS)
-subdirs: $(SUBDIRS)
-
$(SUBDIRS):
$(MAKE) -j $(JOBS) $(MAKECMDGOALS) -C $@
clean: $(SUBDIRS)
- $(RM) -r $(DESTDIR) $(DESTDIR).tar.zst
-
-create-basedir:
- install -d -m 0755 $(DESTDIR)
- install -d -m 0755 $(DESTDIR)/bin
- install -d -m 0755 $(DESTDIR)/boot
- install -d -m 0755 $(DESTDIR)/etc
- install -d -m 0755 $(DESTDIR)/home
- install -d -m 0755 $(DESTDIR)/lib
- install -d -m 0755 $(DESTDIR)/mnt
- install -d -m 0755 $(DESTDIR)/opt
- install -d -m 0755 $(DESTDIR)/proc
- install -d -m 0755 $(DESTDIR)/root
- install -d -m 0755 $(DESTDIR)/sbin
- install -d -m 0755 $(DESTDIR)/tmp
- install -d -m 0755 $(DESTDIR)/usr
- install -d -m 0755 $(DESTDIR)/usr/bin
- install -d -m 0755 $(DESTDIR)/usr/include
- install -d -m 0755 $(DESTDIR)/usr/lib
- install -d -m 0755 $(DESTDIR)/usr/local
- install -d -m 0755 $(DESTDIR)/usr/local/bin
- install -d -m 0755 $(DESTDIR)/usr/local/include
- install -d -m 0755 $(DESTDIR)/usr/local/man
- install -d -m 0755 $(DESTDIR)/usr/local/sbin
- install -d -m 0755 $(DESTDIR)/usr/local/share
- install -d -m 0755 $(DESTDIR)/usr/local/src
- install -d -m 0755 $(DESTDIR)/usr/sbin
- install -d -m 0755 $(DESTDIR)/usr/share
- install -d -m 0755 $(DESTDIR)/usr/src
- install -d -m 0755 $(DESTDIR)/var
- install -d -m 0755 $(DESTDIR)/var/cache
- install -d -m 0755 $(DESTDIR)/var/lib
- install -d -m 0755 $(DESTDIR)/var/lock
- install -d -m 0755 $(DESTDIR)/var/log
- install -d -m 0755 $(DESTDIR)/var/run
- install -d -m 0755 $(DESTDIR)/var/tmp
-
-install: create-basedir subdirs
- cp -R etc/* $(DESTDIR)/etc
- cp -R usr.share/* $(DESTDIR)/usr/share
- tar -cvf $(DESTDIR).tar $(DESTDIR)
- zstd $(DESTDIR).tar
- $(RM) -r $(DESTDIR) $(DESTDIR).tar
-
-install-headers: subdirs
- cp -R include/* $(DESTDIR)/usr/include
-
-install-kernel: subdirs
-install-modules: subdirs
+install: $(SUBDIRS)