kvm: testsuite: use "$(CC)" instead of "gcc" to find libgcc
[kvm-userspace.git] / user / Makefile
blob225a435d1ae3f31c4e670d7ceef78006b0239b23
2 include config.mak
4 DESTDIR :=
6 .PHONY: arch_clean clean
8 #make sure env CFLAGS variable is not used
9 CFLAGS =
11 libgcc := $(shell $(CC) --print-libgcc-file-name)
13 #include architecure specific make rules
14 include config-$(ARCH).mak
16 # cc-option
17 # Usage: OP_CFLAGS+=$(call cc-option, -falign-functions=0, -malign-functions=0)
19 cc-option = $(shell if $(CC) $(1) -S -o /dev/null -xc /dev/null \
20 > /dev/null 2>&1; then echo "$(1)"; else echo "$(2)"; fi ;)
22 CFLAGS += -O1
23 CFLAGS += $(autodepend-flags) -g -fomit-frame-pointer -Wall
24 CFLAGS += $(call cc-option, -fno-stack-protector, "")
25 CFLAGS += $(call cc-option, -fno-stack-protector-all, "")
26 CFLAGS += -I ../libkvm
28 LDFLAGS += $(CFLAGS) -L ../libkvm
30 CXXFLAGS = $(autodepend-flags)
32 autodepend-flags = -MMD -MF $(dir $*).$(notdir $*).d
34 kvmctl: LDFLAGS += -pthread -lrt
36 kvmctl: $(kvmctl_objs)
37 $(CC) $(LDFLAGS) $^ -o $@
39 %.o: %.S
40 $(CC) $(CFLAGS) -c -nostdlib -o $@ $^
42 -include .*.d
44 clean: arch_clean
45 $(RM) kvmctl *.o *.a .*.d