Remove building with NOCRYPTO option
[minix3.git] / minix / kernel / arch / i386 / Makefile.inc
blob2e13ce45e7b14c7a0e5f550c303f7bd3d2fbc058
1 # Makefile for arch-dependent kernel code
2 .include <bsd.own.mk>
4 HERE=${.CURDIR}/arch/${MACHINE_ARCH}
5 .PATH:  ${HERE}
7 # objects we want unpaged from -lc
8 MINLIB_OBJS_UNPAGED= _cpufeature.o _cpuid.o get_bp.o
9 _cpufeature.o:  ${NETBSDSRCDIR}/minix/lib/libc/arch/${MACHINE_ARCH}/_cpufeature.c
10 _cpuid.o:       ${NETBSDSRCDIR}/minix/lib/libc/arch/${MACHINE_ARCH}/_cpuid.S
11 get_bp.o:       ${NETBSDSRCDIR}/minix/lib/libc/arch/${MACHINE_ARCH}/get_bp.S
13 # objects we want unpaged from -lsys
14 SYS_OBJS_UNPAGED=assert.o stacktrace.o
15 assert.o:       ${NETBSDSRCDIR}/minix/lib/libsys/assert.c
16 stacktrace.o:   ${NETBSDSRCDIR}/minix/lib/libsys/stacktrace.c
18 # objects we want unpaged from -lminc
19 MINC_OBJS_UNPAGED= atoi.o \
20         printf.o subr_prf.o \
21         strcmp.o strcpy.o strlen.o strncmp.o \
22         memcpy.o memmove.o memset.o \
23         udivdi3.o umoddi3.o qdivrem.o
24 atoi.o:         ${NETBSDSRCDIR}/minix/lib/libminc/atoi.c
25 printf.o:       ${NETBSDSRCDIR}/sys/lib/libsa/printf.c
26 subr_prf.o:     ${NETBSDSRCDIR}/sys/lib/libsa/subr_prf.c
27 memcpy.o:       ${NETBSDSRCDIR}/common/lib/libc/arch/i386/string/memcpy.S
28 memmove.o:      ${NETBSDSRCDIR}/common/lib/libc/arch/i386/string/memmove.S
29 memset.o:       ${NETBSDSRCDIR}/common/lib/libc/arch/i386/string/memset.S
30 strlen.o:       ${NETBSDSRCDIR}/common/lib/libc/arch/i386/string/strlen.S
31 strcpy.o:       ${NETBSDSRCDIR}/common/lib/libc/arch/i386/string/strcpy.S
32 strcmp.o:       ${NETBSDSRCDIR}/common/lib/libc/arch/i386/string/strcmp.S
34 # the following is required by pre_init.c
35 strncmp.o:      ${NETBSDSRCDIR}/common/lib/libc/string/strncmp.c
37 # these are required by kprintn.o:
38 udivdi3.o:      ${NETBSDSRCDIR}/common/lib/libc/quad/udivdi3.c
39 umoddi3.o:      ${NETBSDSRCDIR}/common/lib/libc/quad/umoddi3.c
40 qdivrem.o:      ${NETBSDSRCDIR}/common/lib/libc/quad/qdivrem.c
42 # LSC: putchar and kputc have the same signature. A bit hackish.
43 CPPFLAGS.subr_prf.c+= -Dputchar=kputc
45 # Activate optional support, may be deactivated.
46 CPPFLAGS.subr_prf.c+= -DLIBSA_PRINTF_LONGLONG_SUPPORT -DLIBSA_PRINTF_WIDTH_SUPPORT
48 # some object files we give a symbol prefix (or namespace) of __k_unpaged_
49 # that must live in their own unique namespace.
51 .for unpaged_obj in head.o pre_init.o direct_tty_utils.o \
52         pg_utils.o klib.o utility.o arch_reset.o \
53         io_inb.o io_outb.o \
54         ${MINLIB_OBJS_UNPAGED} ${MINC_OBJS_UNPAGED} ${SYS_OBJS_UNPAGED}
56 CLEANFILES+=${unpaged_obj}.bin
57 .if ${USE_BITCODE:Uno} == "yes"
58 unpaged_${unpaged_obj}: ${unpaged_obj}
59         if file -b ${.OBJDIR}/${unpaged_obj} | grep -q '^LLVM'; then \
60                 ${LLC} -O1 -march=x86 -mcpu=i586 -filetype=obj -o ${.OBJDIR}/${unpaged_obj}.bin ${.OBJDIR}/${unpaged_obj}; \
61         else \
62                 cp ${.OBJDIR}/${unpaged_obj} ${.OBJDIR}/${unpaged_obj}.bin; \
63         fi
64         ${OBJCOPY} --prefix-symbols=__k_unpaged_ ${.OBJDIR}/${unpaged_obj}.bin $@
65 .else
66 unpaged_${unpaged_obj}: ${unpaged_obj}
67         ${OBJCOPY} --prefix-symbols=__k_unpaged_ ${.OBJDIR}/${unpaged_obj} $@
68 .endif
69 UNPAGED_OBJS += unpaged_${unpaged_obj}
70 ORIG_UNPAGED_OBJS += ${unpaged_obj}
71 .endfor
73 CLEANFILES+= ${ORIG_UNPAGED_OBJS}
75 SRCS+=  mpx.S arch_clock.c arch_do_vmctl.c arch_system.c \
76         klib.S memory.c protect.c direct_tty_utils.c arch_reset.c pg_utils.c
78 SRCS+=  do_iopenable.c do_readbios.c do_sdevio.c exception.c i8259.c oxpcie.c \
79         usermapped_data_arch.c \
80         io_inb.S io_inl.S io_intr.S io_inw.S io_outb.S io_outl.S io_outw.S \
81         usermapped_glo_ipc.S
83 OBJS.kernel+=   ${UNPAGED_OBJS}
85 .ifdef CONFIG_SMP
86 SRCS += arch_smp.c trampoline.S
87 .endif
89 .if ${USE_ACPI} != "no"
90 SRCS+= acpi.c
91 CPPFLAGS+= -DUSE_ACPI
92 .endif
94 .if ${USE_APIC} != "no"
95 SRCS+= apic.c apic_asm.S
96 CPPFLAGS+= -DUSE_APIC
97 .endif
99 .if ${USE_DEBUGREG} != "no"
100 SRCS+=  breakpoints.c debugreg.S
101 .endif
103 .if ${USE_WATCHDOG} != "no"
104 SRCS+= arch_watchdog.c
105 CPPFLAGS+= -DUSE_WATCHDOG
106 .endif
108 klib.o mpx.o head.o: procoffsets.h
110 SRCS+= procoffsets.h
112 PROCOFFSETSCF=procoffsets.cf
114 .PATH: ${NETBSDSRCDIR}/minix/include/arch/${MACHINE_ARCH}/include
116 procoffsets.h: ${PROCOFFSETSCF} kernel.h proc.h stackframe.h archtypes.h
117         ${_MKTARGET_CREATE}
118         ${TOOL_CAT} ${HERE}/${PROCOFFSETSCF} | \
119                 ${TOOL_GENASSYM} -- ${CC} ${CFLAGS:N-Wa,*} \
120                 ${CPPFLAGS} ${PROF} ${${USE_BITCODE:Uno} == "yes":? -fno-lto:} \
121                 ${GENASSYM_CPPFLAGS} >$@.tmp && \
122           mv -f $@.tmp $@ 
124 sconst.h: procoffsets.h
125 apic_asm.o head.o klib.o mpx.o: sconst.h