aboutsummaryrefslogtreecommitdiff
path: root/rules.mak
AgeCommit message (Collapse)AuthorFilesLines
2013-05-03win32: fix compilation againPaolo Bonzini1-5/+1
While commit c02817e5bfbb27955cac970019e6670dc427bc41 fixed compilation without an installed libtool, moving the dependencies to rules.mak does not work because the version-*-y variables are not defined yet. Building in a clean tree thus fails. Revert the commit and remove the dummy /bin/false assignment to LIBTOOL. This makes the build work, at the price of slightly worse errors when there are Makefile bugs. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Message-id: 1367425815-15083-1-git-send-email-pbonzini@redhat.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-04-30rules.mk: Fix build breakageDunrong Huang1-1/+1
The following error occurs when building dtc module: CHK version_gen.h CC libfdt/fdt.o cc1: error: dtc: No such file or directory [-Werror] cc1: all warnings being treated as errors make[1]: *** [libfdt/fdt.o] Error 1 make: *** [subdir-dtc] Error 2 In rules.mak, "-I$(<D) -I$(@D)" was expanded to "-Idtc -I." when building submodule dct. Due to the using of "-Wmissing-include-dirs, a warning would be rarsed. To avoid it, add "-I$(<D) -I$(@D)" to QEMU_INCLUDES instead of QEMU_CFLAGS so that QEMU_CFLAGS does not contain the "-Idtc". Cc: Peter Crosthwaite <peter.crosthwaite@xilinx.com> Cc: Blue Swirl <blauwirbel@gmail.com> Cc: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Dunrong Huang <riegamaths@gmail.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Message-id: 1367247132-19622-1-git-send-email-riegamaths@gmail.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-04-27win32: move Makefile dependencies on version-obj-y to rules.makPaolo Bonzini1-0/+3
This makes the test on $(LIBTOOL) work. Otherwise, LIBTOOL is /bin/false by the time the test is done. Fixes Win32 compilation without a working cross-libtool. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-04-27win32: add generic RC rules to rules.makPaolo Bonzini1-0/+4
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-04-24libcacard: fix mingw64 cross-compilationMarc-André Lureau1-1/+2
Compile and link with version.lo Signed-off-by: Marc-André Lureau <mlureau@redhat.com> Reviewed-by: Alon Levy <alevy@redhat.com>
2013-04-24build-sys: must link with -fstack-protectorMarc-André Lureau1-0/+1
It is needed to give that flag to the linker as well, but latest libtool 2.4.2 still swallows that argument, so let's pass it with libtool -Wc argument. qemu-1.4.0/stubs/arch-query-cpu-def.c:6: undefined reference to `__stack_chk_guard' Signed-off-by: Marc-André Lureau <mlureau@redhat.com> Reviewed-by: Alon Levy <alevy@redhat.com>
2013-01-30rules/mak: make clean should blow away timestamp filesMichael S. Tsirkin1-0/+5
Using a global pattern makes it easier to clean out old generated files. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2013-01-30rules.mak: cleanup config generation rulesMichael S. Tsirkin1-5/+4
This addresses two issues with config generation 1. rule generating timestamp has side effect. Thus cleanup on error does not work. 2. rule for handling timestamp is too generic. It can create any missing .h file. As a result when .h file is removed, build might try to create it using this rule which results in build errors. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2013-01-12build: move version-obj-y to the generic LINK rulePaolo Bonzini1-2/+2
There is no reason for it to be in block-obj-y, in particular. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-01-12libcacard: require libtool to build itPaolo Bonzini1-5/+1
Do not fail at build time, instead just disable the library if libtool is not present. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-01-12build: move dtrace rules to rules.makPaolo Bonzini1-0/+9
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-01-12build: support linking with libtool objects/librariesPaolo Bonzini1-2/+8
This patch moves the complication of using libtool to the generic rules.mak file. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-01-12build: make libtool verbose when making with V=1Paolo Bonzini1-1/+2
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-01-12optionrom: build with discrete CPP and AS stepsBlue Swirl1-2/+5
Build option ROM .S files with separate preprocessor and assembler steps because the C compiler could be unsuitable. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-12-19build: add $(TARGET_DIR) to "GEN config-target.h" linesPaolo Bonzini1-1/+1
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-12-19build: adjust setting of QEMU_INCLUDESPaolo Bonzini1-0/+3
Make it correct for nested directories, and move the static part from Makefile to configure. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-11-18build: replace weak symbols with a static libraryPaolo Bonzini1-1/+1
Weak symbols were a nice idea, but they turned out not to be a good one. Toolchain support is just too sparse, in particular llvm-gcc is totally broken. This patch uses a surprisingly low-tech approach: a static library. Symbols in a static library are always overridden by symbols in an object file. Furthermore, if you place each function in a separate source file, object files for unused functions will not be taken in. This means that each function can use all the dependencies that it needs (especially QAPI stuff such as error_setg). Thus, all stubs are placed in separate object files and put together in a static library. The library then is linked to all programs. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Tested-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Tested-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-08-16Support using a different compiler for Objective-C filesPeter Maydell1-1/+1
MacOSX 10.8 ("Mountain Lion") requires us to compile our one Objective-C source file with clang even if the rest of QEMU requires a real gcc, because the system headers we use make use of Apple's "Blocks" extension to C/ObjC, and mainline gcc doesn't support that. Since we only need to use a true gcc for the parts of QEMU that use the fixed-register env variable, we can simply use clang to build the ObjC file: it will link to the gcc-built objects with no problems. Add the necessary support for an OBJCC variable in the makefile and configure machinery; we default to clang if we have it, otherwise whatever CC is (since gcc might be the Apple gcc which does support Blocks). Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-07-28build: get dependency file directories from object file namesPaolo Bonzini1-1/+2
After commit dcff25f2cd8c11a9368cc2369aeb0319c32d9e26, Dependency file are taken from the directories that have a Makefile.objs file. This is not enough, since files can be included from other directories. So, pick them from directories that have an object file in them. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-06-19make: automatically include dependencies in recursive subdir rules (v2)Anthony Liguori1-0/+1
I think I understand enough of what's going on in these rules to ensure this is right. But I could certainly use a second or third opinion... Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-06-07build: do not create directories at configure timePaolo Bonzini1-0/+1
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-06-07build: add rules for nestingPaolo Bonzini1-0/+39
This adds the 'magic' rules that take care of subdirectories. The subdirectory makefiles in the source tree are not complete; they only define some variables (listed in nested-vars) according to the configuration. The magic rules descend into subdirectory makefiles and gather the evaluated values of those variables. The values from all subdirectories are joined together, each prefixed with the subdirectory name, and used by the "real" makefiles. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-04-25Beautify makefile commands for generation of files with tracetoolLluís Vilanova1-0/+3
Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2012-03-30test makefile overhaulPaolo Bonzini1-1/+1
This introduces new test reporting infrastructure based on gtester and gtester-report. Also, all existing tests are moved to tests/, and tests/Makefile is reorganized to factor out the commonalities in the rules. Signed-off-by: Anthony Liguori <aliguori@linux.vnet.ibm.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-09-01build: sort objects to remove duplicates for linkStefan Hajnoczi1-1/+1
Avoid duplicate object files during the link. There are legitimate cases where a link command-line would include duplicate object files because two independent subsystems both depend on common infrastructure. Use GNU make's $(sort) function to remove duplicate object files from the link command-line. Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-08-22Improvements to libtool support.Brad1-1/+1
Improvements to the libtool support in QEMU. Replace hard coded libtool in the infrastructure with $(LIBTOOL) and allow overriding the libtool binary used via the configure script. Reviewed-by: Andreas F=E4rber <andreas.faerber@web.de> Signed-off-by: Brad Smith <brad@comstyle.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-08-12build: Move QEMU_INCLUDES before QEMU_CFLAGSJiri Denemark1-4/+4
This patch fixes build when any of the include paths from QEMU_CFLAGS contains a header file with similar name to a header file in qemu sources. I hit it with error.h included by qapi/qapi-types-core.h. GCC decided to use /usr/include/alsa/error.h instead of qemu's error.h. Tested-by: Michael Roth <mdroth@linux.vnet.ibm.com> Signed-off-by: Jiri Denemark <jdenemar@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-06-14libcacard: add libcacard.la targetAlon Levy1-0/+8
No flag to configure is required. Instead, added a libcacard.la target that is not built by default, only when requested explicitly via: mkdir build cd build ../configure make libcacard.la make install-libcacard Uses libtool to do actual linking of object files and shared library, and installing. Tested only under linux, but supposed to work on other systems as well. If libtool isn't found you get a message complaining about that, only at build time (since it is not a default target I did not add a message at configure time). New build artifacts: .libs subdirectories (at <buildroot> and <buildroot>/libcacard) *.lo files (at same locations as the respective o files) Added %.lo : %.c rule that uses libtool. Updated clean rule to clean up those artifacts. Added specific rule to call dtrace with libtool wrapper (note that because of a current upstream dtrace bug fixed by systemtap b1568fd85 commit the -fPIC flag isn't actually passed on. still current dtrace+libtool produced object links fine). If libtool is missing any of the following targets will complain and exit 1: any subdir: *.lo root and libcacard: libcacard.la, libcacard-instsall Tested to link and load with all tracing backends.
2011-01-20Add scripts directoryBlue Swirl1-1/+1
Move build and user scripts into scripts directory. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-01-14do not pass bogus $(SRC_PATH) include paths to cc during configurePaolo Bonzini1-3/+3
Non-existent -I paths are dropped silently by the compiler, but still it is not polite to pass bogus options. Configure-time tests do not need any include files from the source path, so only include -I flags at make time (when they're properly expanded). Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-10-23rewrite i386 tests MakefilePaolo Bonzini1-0/+9
1) compute path to i386 compiler from configure. If it is found, run the i386 tests. I use macros so that this approach could be applied for other arches as well. 2) provide an easily extensible way to add tests Most tests fail, but at least "make test" does something meaningful. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-05-22Put dependency files in proper subdirJan Kiszka1-1/+1
This seems to resolve subtle breakages of our build system: Dependency files generated for targets like 'dir/foo.o' were saved as 'foo.d'. Now, if there was also a target 'foo.o', one of the dependency file was overwritten. Concrete example: libhw*/macio.o vs. libhw*/ide/macio.o. And this often left a segfaulting build result behind when changing the "wrong" data structures". Fix it by generating proper 'dir/foo.d'. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Acked-by: Paolo Bonzini <pbonzini@redhat.com> Acked-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-05-03fix whitespace bogon in some versions of makeNathan Froyd1-1/+1
With three different make binaries I have available, configuring a pristine QEMU tree and attempting to make gives the cryptic: Makefile:27: *** missing separator. Stop. This patch fixes it (presumably because it makes the output of `set-vpath' be an empty string, rather than a bit of whitespace), but I don't understand why this hasn't been a problem for other folks before. Signed-off-by: Nathan Froyd <froydnj@codesourcery.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-01-08finish VPATH -> vpath translationPaolo Bonzini1-1/+2
This adds a few more vpath suffixes and points the remaining two paths explicitly to $(SRC_PATH) in order to eliminate the VPATH assignment from config-host.mak. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Cc: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-01-08Use vpath directivePaolo Bonzini1-0/+2
The vpath directive has two advantages over the VPATH variable: 1) it allows to skip searching of .o files; 2) the default semantics are to append to the vpath, so there is no confusion between "VPATH=xyz" and "VPATH+=xyz". Since "vpath %.c %.h PATH" is not valid, I'm introducing a wrapper macro to append one or more directories to the vpath. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-01-07Drop --whole-archive and static librariesAndreas Färber1-2/+2
Juan has contributed a cool Makefile infrastructure that enables us to drop static libraries completely: Move shared obj-y definitions to Makefile.objs, prefixed {common-,hw-,user-}, and link those object files directly into the executables. Replace HWLIB by HWDIR, specifying only the directory. Drop --whole-archive and ARLIBS in Makefiles and configure. Drop GENERATED_HEADERS dependency in rules.mak, since this rebuilds all common objects after generating a target-specific header; add dependency rules to Makefile and Makefile.target instead. v2: - Don't try to include /config.mak for user emulators - Changes to user object paths ("Quickfix for libuser.a drop") were obsoleted by "user_only: compile everything with -fpie" (Kirill A. Shutemov) v3: - Fix dependency modelling for tools - Remove comment on GENERATED_HEADERS obsoleted by this patch Signed-off-by: Andreas Färber <afaerber@opensolaris.org> Cc: Blue Swirl <blauwirbel@gmail.com> Cc: Palle Lyckegaard <palle@lyckegaard.dk> Cc: Ben Taylor <bentaylor.solx86@gmail.com> Cc: Juan Quintela <quintela@trasno.org> Cc: Kirill A. Shutemov <kirill@shutemov.name> Cc: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-12-07qemu: delete rule target on errorMichael S. Tsirkin1-0/+3
Instruct make to remove any rule target on error. This prevetns situation where there was an error during build but generated file still stays behind. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-12-03Fix build for mingw32 on windows ($@ in macro)Stefan Weil1-4/+5
Make using mingw32 on windows does not preserve $@ in macros when they are modified using this pattern: target: macro += something This behaviour results in an error when QEMU_CFLAGS containing "-MMD -MP -MT $@" is modified for compilation of source files which use SDL: $@ will expand to nothing, -MT no longer has the correct argument (it will take the next one from the command line) and the build will fail or run with a wrong command line. The problem is fixed by using a new macro QEMU_DGFLAGS which is not modified by a target rule. Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-11-14Do not execute shell scripts directlymalc1-1/+1
Signed-off-by: malc <av1474@comtv.ru>
2009-11-12fix type in CFLAGS nameJuan Quintela1-1/+1
Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-11-12fix parallel buildJuan Quintela1-1/+1
Based on a ideas of Daniel Jacobowitz + Stefan Weil Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-10-30Add *CFLAGS to LINK in rules.makPeter Hjalmarsson1-1/+1
Sometimes when linking with gcc to get a predictable result you are suggested to also apply the compiler flags to the linker command. For reference, please read: http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Link-Options.html Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-10-11Move dependency generation falgs out of configuremalc1-0/+2
Signed-off-by: malc <av1474@comtv.ru>
2009-10-08Move generation of config-host.h to Makefile from configureJuan Quintela1-0/+9
Use timestamp based appreach to avoid not needed recompilation. Add it to rules.mak Many thanks to Paolo Bonzini for helpding the design, and the debug. Patchworks-ID: 35190 Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-10-06Don't use implicit rules for MakefileJuan Quintela1-0/+12
This remove implicit rules + implicit variables. Explicit rules like the generation of %.h and %.c from %.hx still works as expected. As an added bonus, now the output of make -d is readable. As another added bonus, time spend on Makefiles is way smaller. We run make -j3 in a fully compiled tree, and results are: Before: $ time make -j3 real 0m1.225s user 0m1.660s sys 0m0.253s After: $ time make -j3 real 0m0.422s user 0m0.393s sys 0m0.248s Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-10-05restore CFLAGS check for conflict and fix recursive CFLAGS issueThomas Monjalon1-2/+2
cc-option uses more make-syntax to replace the shell "if/else". Issue with recursive += is fixed by doing the first assignment simply-expanded, as explained in http://www.gnu.org/software/make/manual/html_node/Appending.html Signed-off-by: Thomas Monjalon <thomas@monjalon.net> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-09Remove CFLAGS parameter in cc-optionJuan Quintela1-3/+3
With cc-option we are testing if gcc just accept a particular option, we don't need CFLAGS at all. And this fixes the recursive problem with CFLAGS Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-08-10Rename CPPFLAGS to QEMU_CFLAGSJuan Quintela1-3/+3
Now we have to variables: QEMU_CFLAGS: flags without which we can't compile CFLAGS: "-g -O2" We can now run: make CFLAGS="-fbar" foo.o make CFLAGS="" foo.o make CFLAGS="-O3" foo.o And it all should work. Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> Message-Id:
2009-07-27move cc-option definition to rules.makJuan Quintela1-0/+6
Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-06-30Remove bogus -WerrorPaul Brook1-1/+1
Revert rules.mak changes from aba800a. These should not have been here to start with. Signed-off-by: Paul Brook <paul@codesourcery.com>