From f9b4231a673d75dd6404ac5df8a47adc04437e6b Mon Sep 17 00:00:00 2001 From: Keir Fraser Date: Wed, 28 May 2008 09:30:48 +0100 Subject: stubdom: make the build more generic by moving as many stubdom parts into stubdom/ as possible. That also permits to build all of ioemu, c and caml stubdoms at the same time. Signed-off-by: Samuel Thibault --- extras/mini-os/Makefile | 33 +++++++-------------------------- 1 file changed, 7 insertions(+), 26 deletions(-) (limited to 'extras/mini-os/Makefile') diff --git a/extras/mini-os/Makefile b/extras/mini-os/Makefile index 8cec019e42..18497e1843 100644 --- a/extras/mini-os/Makefile +++ b/extras/mini-os/Makefile @@ -73,44 +73,25 @@ lwip.a: $(LWO) OBJS += lwip.a endif -OBJS := $(filter-out lwip%.o $(LWO), $(OBJS)) - -ifeq ($(caml),y) -CAMLLIB = $(shell ocamlc -where) -APP_OBJS += main-caml.o -APP_OBJS += $(CAMLDIR)/caml.o -APP_OBJS += $(CAMLLIB)/libasmrun.a -CFLAGS += -I$(CAMLLIB) -APP_LDLIBS += -lm -endif -OBJS := $(filter-out main-caml.o, $(OBJS)) - -ifeq ($(qemu),y) -APP_OBJS += $(QEMUDIR)/i386-dm-stubdom/qemu.a $(QEMUDIR)/i386-dm-stubdom/libqemu.a -CFLAGS += -DCONFIG_QEMU -endif - -ifneq ($(CDIR),) -APP_OBJS += $(CDIR)/main.a -APP_LDLIBS += -endif +OBJS := $(filter-out main.o lwip%.o $(LWO), $(OBJS)) ifeq ($(libc),y) APP_LDLIBS += -L$(XEN_ROOT)/stubdom/libxc -whole-archive -lxenguest -lxenctrl -no-whole-archive APP_LDLIBS += -lpci APP_LDLIBS += -lz +APP_LDLIBS += -lm LDLIBS += -lc endif -ifneq ($(caml)-$(qemu)-$(CDIR)-$(lwip),---y) +ifneq ($(APP_OBJS)-$(lwip),-y) OBJS := $(filter-out daytime.o, $(OBJS)) endif -app.o: $(APP_OBJS) app.lds - $(LD) -r -d $(LDFLAGS) $^ $(APP_LDLIBS) --undefined main -o $@ +$(TARGET)_app.o: $(APP_OBJS) app.lds + $(LD) -r -d $(LDFLAGS) $^ $(APP_LDLIBS) --undefined app_main -o $@ -$(TARGET): links $(OBJS) app.o arch_lib - $(LD) -r $(LDFLAGS) $(HEAD_OBJ) app.o $(OBJS) $(LDARCHLIB) $(LDLIBS) -o $@.o +$(TARGET): links $(OBJS) $(TARGET)_app.o arch_lib + $(LD) -r $(LDFLAGS) $(HEAD_OBJ) $(TARGET)_app.o $(OBJS) $(LDARCHLIB) $(LDLIBS) -o $@.o $(OBJCOPY) -w -G $(GLOBAL_PREFIX)* -G _start $@.o $@.o $(LD) $(LDFLAGS) $(LDFLAGS_FINAL) $@.o $(EXTRA_OBJS) -o $@ gzip -f -9 -c $@ >$@.gz -- cgit v1.2.3