KBUILD_CFLAGS := -g -Os -Wall -Wstrict-prototypes -Wtype-limits \
-Wmissing-declarations -Wmissing-prototypes \
-fno-strict-aliasing -fomit-frame-pointer -fno-pic \
- -fno-common -fno-stack-protector $(INCLUDES)
+ -fno-common -fno-stack-protector -DJAILHOUSE $(INCLUDES)
ifneq ($(wildcard $(src)/../hypervisor/include/jailhouse/config.h),)
KBUILD_CFLAGS += -include $(src)/../hypervisor/include/jailhouse/config.h
endif
OBJCOPYFLAGS := -O binary
-LDFLAGS += -T
+LDFLAGS += --gc-sections -T
-subdir-y := lib/$(SRCARCH) demos/$(SRCARCH)
+subdir-y := lib/$(SRCARCH) demos/$(SRCARCH) tools/$(SRCARCH)
-# demos depend on the library
-$(obj)/demos/$(SRCARCH): $(obj)/lib/$(SRCARCH)
+# demos and tools depend on the library
+$(obj)/demos/$(SRCARCH) $(obj)/tools/$(SRCARCH): $(obj)/lib/$(SRCARCH)