2 # Makefile for elksemu.
5 # Use BCC to make a tiny static a.out version.
7 CFLAGS
=-Ml
-ansi
-s
$(DEFS
)
10 CFLAGS
=-Ml
-ansi
-s
$(DEFS
)
18 # Turn on elkemu's strace like facility.
21 # For gcc making a.out with a basically ELF compiler
22 # CFLAGS=-O2 -fno-strength-reduce -b i486-linuxaout -N -s -static
24 OBJ
=elks.o elks_sys.o elks_signal.o minix.o
27 $(CC
) $(CFLAGS
) -o
$@
$^
29 elks_sys.o
: call_tab.v efile.h
33 -cp
-p ..
/libc
/syscall
/call_tab.v .
2>/dev
/null
34 -cp
-p ..
/libc
/syscall
/defn_tab.v .
2>/dev
/null
36 efile.h
: ..
/libc
/error
/liberror.txt
37 sh mkefile ..
/libc
/error
/liberror.txt
41 # The kernel patch or module _requires_ this location but binfmt-misc is easy
44 install -d
$(DIST
)/lib
45 install -s
-o root
-g root
-m
4555 elksemu
$(DIST
)/lib
/elksemu
48 rm -f
$(OBJ
) binfmt_elks.o elksemu call_tab.v defn_tab.v efile.h
52 # HOW to compile the module...
53 # BUT remember you don't need it for a recent 2.1.X; use binfmt_misc.
55 # This matches my compile (2.0.x); yours may be different.
56 MODCFLAGS
=-D__KERNEL__
-Wall
-Wstrict-prototypes
-O2
-fomit-frame-pointer \
57 -fno-strength-reduce
-pipe
-m486
-DCPU
=486 -DMODULE
-DMODVERSIONS \
58 -include /usr
/include/linux
/modversions.h
60 binfmt_elks.o
: binfmt_elks.c
61 gcc
-c
$(MODCFLAGS
) binfmt_elks.c
63 # This is another option
64 #MODCFLAGS=-O -fomit-frame-pointer -DCPU=386 -D__KERNEL__ -DMODULE
66 #MODCFLAGS=-O -fomit-frame-pointer -D__KERNEL__ -DMODULE -DCONFIG_MODVERSIONS