aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.hgignore2
-rw-r--r--extras/mini-os/Makefile22
2 files changed, 14 insertions, 10 deletions
diff --git a/.hgignore b/.hgignore
index 9d33291c17..481c9f3745 100644
--- a/.hgignore
+++ b/.hgignore
@@ -58,7 +58,7 @@
^docs/xen-api/xenapi-datamodel-graph.eps$
^extras/mini-os/h/hypervisor-ifs$
^extras/mini-os/h/xen-public$
-^extras/mini-os/mini-os\..*$
+^extras/mini-os/mini-os.*$
^install/.*$
^linux-[^/]*-native/.*$
^linux-[^/]*-xen/.*$
diff --git a/extras/mini-os/Makefile b/extras/mini-os/Makefile
index f042d1a18f..0fa1baccd5 100644
--- a/extras/mini-os/Makefile
+++ b/extras/mini-os/Makefile
@@ -17,7 +17,13 @@ CFLAGS += -D__XEN_INTERFACE_VERSION__=$(XEN_INTERFACE_VERSION)
ASFLAGS = -D__ASSEMBLY__
LDLIBS = -L. -lminios
-LDFLAGS := -N -T minios-$(TARGET_ARCH).lds
+LDFLAGS_FINAL := -N -T minios-$(TARGET_ARCH).lds
+LDFLAGS :=
+
+# Prefix for global API names. All other symbols are localised before
+# linking with EXTRA_OBJS.
+GLOBAL_PREFIX := xenos_
+EXTRA_OBJS =
# For possible special source directories.
EXTRA_SRC =
@@ -110,18 +116,16 @@ endif
links: $(ARCH_LINKS)
[ -e include/xen ] || ln -sf ../../../xen/include/public include/xen
-libminios.a: links $(OBJS) $(HEAD)
- $(AR) r libminios.a $(HEAD) $(OBJS)
-
-$(TARGET): libminios.a $(HEAD)
- $(LD) $(LDFLAGS) $(HEAD) $(LDLIBS) -o $@.elf
- gzip -f -9 -c $@.elf >$@.gz
+$(TARGET): links $(OBJS) $(HEAD)
+ $(LD) -r $(LDFLAGS) $(HEAD) $(OBJS) -o $@.o
+ $(OBJCOPY) -w -G $(GLOBAL_PREFIX)* -G _start $@.o $@.o
+ $(LD) $(LDFLAGS) $(LDFLAGS_FINAL) $@.o $(EXTRA_OBJS) -o $@
+ gzip -f -9 -c $@ >$@.gz
.PHONY: clean
clean:
find . -type f -name '*.o' | xargs rm -f
- rm -f *.o *~ core $(TARGET).elf $(TARGET).raw $(TARGET) $(TARGET).gz
- rm -f libminios.a
+ rm -f *.o *~ core $(TARGET) $(TARGET).gz
find . -type l | xargs rm -f
rm -f tags TAGS