Fix compilation issues after removal of the kernel/ subdir.
[v86d.git] / Makefile
blob54f817dab0fd94f4d6baf29a11fc5f5f2086505f
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 x86emu lrmi
5 INSTALL = install
7 ifeq ($(call config_opt,CONFIG_KLIBC),true)
8 export CC = klcc
9 endif
11 CFLAGS += -I/lib/modules/$(shell uname -r)/source/include
13 ifeq ($(call config_opt,CONFIG_X86EMU),true)
14 CFLAGS += -Ilibs/x86emu
15 LDFLAGS += -Llibs/x86emu
16 LDLIBS += -lx86emu
17 V86OBJS = v86_x86emu.o
18 V86LIB = x86emu
19 else
20 CFLAGS += -Ilibs/lrmi-0.10
21 LDFLAGS += -Llibs/lrmi-0.10 -static
22 LDLIBS += -llrmi
23 V86OBJS = v86_lrmi.o
24 V86LIB = lrmi
25 endif
27 all: $(V86LIB) v86d
29 %.o: %.c v86.h
30 $(CC) $(CFLAGS) -c -o $@ $<
32 v86d: v86.o v86_mem.o $(V86OBJS)
33 $(CC) $(LDFLAGS) $+ $(LDLIBS) -o $@
35 testvbe: testvbe.o v86_mem.o $(V86OBJS)
36 $(CC) $(LDFLAGS) $+ $(LDLIBS) -o $@
38 x86emu:
39 make -w -C libs/x86emu
41 lrmi:
42 make -e -w -C libs/lrmi-0.10 liblrmi.a
44 clean:
45 rm -rf *.o v86d testvbe
46 $(MAKE) -w -C libs/lrmi-0.10 clean
47 $(MAKE) -w -C libs/x86emu clean
49 distclean: clean
50 rm -rf config.h
52 install:
53 $(INSTALL) -D v86d $(DESTDIR)/sbin/v86d