1 config_opt
= $(shell if
[ -e config.h
-a
-n
"`egrep '^\#define[[:space:]]+$(1)([[:space:]]+|$$)' config.h 2>/dev/null`" ]; then echo true
; fi
)
3 .PHONY
: clean install install_testvbe x86emu lrmi
6 KDIR ?
= /lib
/modules
/$(shell uname
-r
)/source
8 ifeq ($(call config_opt
,CONFIG_KLIBC
),true
)
12 CFLAGS ?
= -Wall
-g
-O2
13 CFLAGS
+= -I
$(KDIR
)/include
15 ifeq ($(call config_opt
,CONFIG_X86EMU
),true
)
16 CFLAGS
+= -Ilibs
/x86emu
17 LDFLAGS
+= -Llibs
/x86emu
19 V86OBJS
= v86_x86emu.o v86_mem.o v86_common.o
22 CFLAGS
+= -Ilibs
/lrmi-0.10
23 LDFLAGS
+= -Llibs
/lrmi-0.10
-static
-Wl
,--section-start
,vm86_ret
=0x9000
25 V86OBJS
= v86_lrmi.o v86_common.o
32 ifeq ($(call config_opt
,CONFIG_DEBUG
),true
)
33 DEBUG_BUILD
+= testvbe
34 DEBUG_INSTALL
+= install_testvbe
37 all: $(V86LIB
) v86d
$(DEBUG_BUILD
)
40 $(CC
) $(CFLAGS
) -c
-o
$@
$<
42 v86d
: $(V86OBJS
) $(V86LIB
) v86.o
43 $(CC
) $(LDFLAGS
) $(V86OBJS
) v86.o
$(LDLIBS
) -o
$@
45 testvbe
: $(V86OBJS
) $(V86LIB
) testvbe.o
46 $(CC
) $(LDFLAGS
) $(V86OBJS
) testvbe.o
$(LDLIBS
) -o
$@
49 $(MAKE
) -w
-C libs
/x86emu
52 $(MAKE
) -e
-w
-C libs
/lrmi-0.10 liblrmi.a
55 rm -rf
*.o v86d testvbe
56 $(MAKE
) -w
-C libs
/lrmi-0.10
clean
57 $(MAKE
) -w
-C libs
/x86emu
clean
62 install: $(DEBUG_INSTALL
)
63 $(INSTALL
) -D v86d
$(DESTDIR
)/sbin
/v86d
66 $(INSTALL
) -D testvbe
$(DESTDIR
)/sbin
/testvbe