diff options
-rw-r--r-- | Makefile | 8 | ||||
-rw-r--r-- | Makefile.target | 7 | ||||
-rw-r--r-- | rules.mak | 10 |
3 files changed, 13 insertions, 12 deletions
@@ -1,12 +1,14 @@ # Makefile for QEMU. include config-host.mak +include $(SRC_PATH)/rules.mak .PHONY: all clean cscope distclean dvi html info install install-doc \ recurse-all speed tar tarbin test VPATH=$(SRC_PATH):$(SRC_PATH)/hw + CFLAGS += $(OS_CFLAGS) $(ARCH_CFLAGS) LDFLAGS += $(OS_LDFLAGS) $(ARCH_LDFLAGS) @@ -188,12 +190,6 @@ libqemu_user.a: $(USER_OBJS) qemu-img$(EXESUF): qemu-img.o qemu-tool.o osdep.o $(BLOCK_OBJS) $(CC) $(LDFLAGS) -o $@ $^ -lz $(LIBS) -%.o: %.c - $(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $< - -%.o: %.m - $(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $< - qemu-nbd$(EXESUF): qemu-nbd.o qemu-tool.o osdep.o $(BLOCK_OBJS) $(CC) $(LDFLAGS) -o $@ $^ -lz $(LIBS) diff --git a/Makefile.target b/Makefile.target index 5f41a3d621..b6d5590f0e 100644 --- a/Makefile.target +++ b/Makefile.target @@ -1,4 +1,5 @@ include config.mak +include $(SRC_PATH)/rules.mak TARGET_BASE_ARCH:=$(TARGET_ARCH) ifeq ($(TARGET_ARCH), x86_64) @@ -731,12 +732,6 @@ else $(SHELL) $(SRC_PATH)/feature_to_c.sh $@ $(TARGET_XML_FILES) endif -%.o: %.c - $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $< - -%.o: %.S - $(CC) $(CPPFLAGS) -c -o $@ $< - clean: rm -f *.o *.a *~ $(PROGS) nwfpe/*.o fpu/*.o rm -f *.d */*.d tcg/*.o diff --git a/rules.mak b/rules.mak new file mode 100644 index 0000000000..fe0697820f --- /dev/null +++ b/rules.mak @@ -0,0 +1,10 @@ + +%.o: %.c + $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $< + +%.o: %.S + $(CC) $(CPPFLAGS) -c -o $@ $< + +%.o: %.m + $(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $< + |