6 .PHONY
: arch_clean
clean
8 #make sure env CFLAGS variable is not used
11 libgcc
:= $(shell $(CC
) --print-libgcc-file-name
)
13 libcflat
:= test/lib
/libcflat.a
19 #include architecure specific make rules
20 include config-
$(ARCH
).mak
23 # Usage: OP_CFLAGS+=$(call cc-option, -falign-functions=0, -malign-functions=0)
25 cc-option
= $(shell if
$(CC
) $(1) -S
-o
/dev
/null
-xc
/dev
/null \
26 > /dev
/null
2>&1; then echo
"$(1)"; else echo
"$(2)"; fi
;)
29 CFLAGS
+= $(autodepend-flags
) -g
-fomit-frame-pointer
-Wall
30 CFLAGS
+= $(call cc-option
, -fno-stack-protector
, "")
31 CFLAGS
+= $(call cc-option
, -fno-stack-protector-all
, "")
32 CFLAGS
+= -I ..
/libkvm
34 LDFLAGS
+= $(CFLAGS
) -L ..
/libkvm
36 CXXFLAGS
= $(autodepend-flags
)
38 autodepend-flags
= -MMD
-MF
$(dir $*).
$(notdir $*).d
40 LDFLAGS
+= -pthread
-lrt
42 kvmtrace_objs
= kvmtrace.o
44 kvmctl
: $(kvmctl_objs
)
45 $(CC
) $(LDFLAGS
) $^
-o
$@
47 kvmtrace
: $(kvmtrace_objs
)
48 $(CC
) $(LDFLAGS
) $^
-o
$@
50 $(libcflat
): $(cflatobjs
)
54 $(CC
) $(CFLAGS
) -c
-nostdlib
-o
$@
$^
59 $(RM
) kvmctl kvmtrace
*.o
*.a .
*.d
$(libcflat
) $(cflatobjs
)