# their Makelocal. This is useful, for example, to allow emacs to find the
# correct file when errors are encountered using its builtin 'M-x compile'
# command.
+VERSION = 0
+PATCHLEVEL = 1
+SUBLEVEL = 0
+EXTRAVERSION =
+VERNAME = Nanwan
+
+KERNELVERSION = $(VERSION)$(if $(PATCHLEVEL),.$(PATCHLEVEL)$(if $(SUBLEVEL),.$(SUBLEVEL)))$(EXTRAVERSION)
+
+export KERNELVERSION VERNAME
+
NO_PRINT_DIRECTORY ?= --no-print-directory
# Save the ability to export the parent's original environment for future use
# generate for non-kbuild targets
OBJDIR ?= obj
+# Don't need to export these, since the Makelocal is included.
+KERNEL_OBJ := $(OBJDIR)/kern/akaros-kernel
+CMP_KERNEL_OBJ := $(KERNEL_OBJ).gz
+
# Symlinks
# =========================================================================
# We have a few symlinks so that code can include <arch/whatever.h>. This
PHONY += symlinks clean_symlinks
clean_symlinks: objclean
- @rm -f kern/include/arch kern/boot user/parlib/include/arch
+ @rm -f kern/include/arch kern/boot user/parlib/include/parlib/arch
arch-link := $(notdir $(shell readlink kern/include/arch))
valid-arches := $(notdir $(wildcard kern/arch/*))
@echo Making symlinks...
$(Q)ln -fs ../arch/$(ARCH) kern/include/arch
$(Q)ln -fs arch/$(ARCH)/boot kern/boot
- $(Q)ln -fs $(ARCH) user/parlib/include/arch
+ $(Q)ln -fs $(ARCH) user/parlib/include/parlib/arch
$(Q)$(MAKE) -f $(srctree)/Makefile clean
else
CFLAGS_KERNEL += -std=gnu99 -fgnu89-inline
CFLAGS_KERNEL += -fno-strict-aliasing -fno-omit-frame-pointer
CFLAGS_KERNEL += -fno-stack-protector
-CFLAGS_KERNEL += -Wall -Wno-format -Wno-unused
+CFLAGS_KERNEL += -Wall -Wno-format -Wno-unused -Werror
CFLAGS_KERNEL += -DROS_KERNEL
CFLAGS_KERNEL += -include include/generated/autoconf.h -include include/common.h
CFLAGS_KERNEL += -fplan9-extensions
else
CFLAGS_KERNEL += -m32 -gstabs
endif
+ifeq ($(CONFIG_BETTER_BACKTRACE),y)
+CFLAGS_KERNEL += -fno-optimize-sibling-calls
+endif
# TODO: do we need this, or can we rely on the compiler's defines?
CFLAGS_KERNEL += -D$(ARCH)
# kernel build output. Right now, it's only passed down to tests/
dummy-1 := $(shell mkdir -p $(OBJDIR)/kern/)
-# Don't need to export these, since the Makelocal is included.
-KERNEL_OBJ := $(OBJDIR)/kern/akaros-kernel
-CMP_KERNEL_OBJ := $(KERNEL_OBJ).gz
-
# Since we're doing this outside of the dot-config part, some targets, such as
# clean, won't read in our .config/auto.conf, and won't know about the
# KFS_PATH. Future rules related to KFS will have issues (mkdir with no
endif
FIRST_KFS_PATH = $(firstword $(kfs-paths))
+ABS_KFS_PATH = $(abspath $(FIRST_KFS_PATH))
-export OBJDIR FIRST_KFS_PATH
+export OBJDIR FIRST_KFS_PATH ABS_KFS_PATH
# Avoiding implicit rules
$(srctree)/Makelocal: ;
quiet_cmd_link-akaros = LINK $@
cmd_link-akaros = $(CONFIG_SHELL) scripts/link-kernel.sh $@ \
kern/arch/$(ARCH)/$(KERNEL_LD) $(LDFLAGS_KERNEL) \
+ --build-id=sha1 \
$(akaros-deps) $(gcc-lib) $(kern_cpio_obj) \
$(ext2_bdev_obj); \
$(ARCH_POST_LINK_CMD)
# List all userspace directories here, and state any dependencies between them,
# such as how pthread depends on parlib.
-user-dirs = parlib pthread benchutil iplib ndblib vmm
+user-dirs = parlib pthread benchutil iplib ndblib vmm perfmon
benchutil: parlib
pthread: parlib benchutil
iplib: parlib
ndblib: iplib
-vmm: parlib
+vmm: parlib benchutil
PHONY += install-libs $(user-dirs)
install-libs: $(user-dirs) symlinks cc-exists
$(user-dirs):
@$(MAKE) -C user/$@ DEPLIBS="$^" && $(MAKE) -C user/$@ install
+user: $(user-dirs)
PHONY += userclean $(clean-user-dirs)
clean-user-dirs := $(addprefix _clean_user_,$(user-dirs))
# Bundled apps
# =========================================================================
-PHONY += apps-install
-apps-install:
+app-dirs =
+tagged-app-dirs := $(subst /,__,$(app-dirs))
+app-dirs-install := $(addprefix _install_,$(tagged-app-dirs))
+app-dirs-clean := $(addprefix _clean_,$(tagged-app-dirs))
+
+PHONY += $(app-dirs-install) $(app-dirs-clean)
+
+$(app-dirs-install):
+ @$(MAKE) -C $(patsubst _install_%,%,$(subst __,/,$@)) install
+
+$(app-dirs-clean):
+ @$(MAKE) -C $(patsubst _clean_%,%,$(subst __,/,$@)) clean
+
+PHONY += apps-install
+apps-install: $(app-dirs-install)
@$(call make_as_parent, -C tools/apps/busybox)
- @$(call make_as_parent, -C tools/profile/kprof2perf install)
- @$(call make_as_parent, -C tools/apps/snc install)
+ @$(call make_as_parent, -C tools/apps/ipconfig install)
+ @$(call make_as_parent, -C tools/dev-libs/elfutils install)
+ @$(call make_as_parent, -C tools/dev-util/perf install)
+ @$(call make_as_parent, -C tools/sys-apps/bash install)
PHONY += apps-clean
-apps-clean:
+apps-clean: $(app-dirs-clean)
@$(call make_as_parent, -C tools/apps/busybox clean)
- @$(call make_as_parent, -C tools/profile/kprof2perf clean)
- @$(call make_as_parent, -C tools/apps/snc clean)
+ @$(call make_as_parent, -C tools/apps/ipconfig clean)
+ @$(call make_as_parent, -C tools/dev-libs/elfutils clean)
+ @$(call make_as_parent, -C tools/dev-util/perf clean)
# Cross Compiler
# =========================================================================
@$(MAKE) userclean
@$(MAKE) install-libs
@$(MAKE) testclean utestclean
- @$(MAKE) tests utest
@$(call make_as_parent, apps-clean)
@$(call make_as_parent, apps-install)
+ @$(MAKE) tests utest
@$(MAKE) fill-kfs
@$(MAKE) akaros-kernel