File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55cscope. *
66* .iso
77* .img
8+ * .debug
89Makeconf.local
910.DS_Store
1011drivers /acpi /acpica /source /
Original file line number Diff line number Diff line change @@ -79,6 +79,8 @@ SHELL := bash
7979RM := rm
8080LN := ln
8181SYMLINK := $(LN ) -s -f
82+ OBJCOPY := objcopy
83+ STRIP := strip
8284
8385GRUB_FILE := grub-file
8486GRUB_MKIMAGE := grub-mkimage
@@ -146,6 +148,7 @@ OBJS := $(SOURCES:%.c=%.o)
146148OBJS += $(ASM_SOURCES:%.S=%.o )
147149
148150TARGET := kernel64.bin
151+ TARGET_DEBUG := $(TARGET ) .debug
149152
150153# On Linux systems, we build directly. On non-Linux, we rely on the 'docker%'
151154# rule below to create an Ubuntu container and perform the Linux-specific build
@@ -169,6 +172,9 @@ $(TARGET): $(OBJS) $(PREP_LINK_SCRIPT)
169172 $(VERBOSE ) rm -rf $(SYMBOLS_NAME ) .S
170173 @echo " LD " $(TARGET ) $(SYMBOLS_NAME ) .o
171174 $(VERBOSE ) $(LD ) -T $(PREP_LINK_SCRIPT ) -o $@ $(OBJS ) $(PFMLIB_LINKER_FLAGS ) $(SYMBOLS_NAME ) .o
175+ @echo " STRIP"
176+ $(VERBOSE ) $(OBJCOPY ) --only-keep-debug $(TARGET ) $(TARGET_DEBUG )
177+ $(VERBOSE ) $(STRIP ) -s $(TARGET )
172178
173179$(PFMLIB_ARCHIVE ) : $(PFMLIB_TARBALL )
174180 @echo " UNTAR libpfm"
@@ -203,6 +209,7 @@ clean:
203209 $(VERBOSE ) find $(KTF_ROOT ) -name cscope.\* -delete
204210 $(VERBOSE ) find $(PFMLIB_DIR ) -mindepth 1 ! -name $(PFMLIB_NAME ) -$(PFMLIB_VER ) .tar.gz -delete
205211 $(VERBOSE ) $(RM ) -rf $(ACPICA_DEST_DIR ) /source
212+ $(VERBOSE ) $(RM ) -f $(TARGET_DEBUG )
206213
207214# Check whether we can use kvm for qemu
208215ifeq ($(SYSTEM ) ,LINUX)
You can’t perform that action at this time.
0 commit comments