Make modules work again part 1: linkup emulation/ and change the architecture
[dragonfly.git] / sys / emulation / svr4 / Makefile
1 # Makefile for syscall tables
2 #
3 # $FreeBSD: src/sys/svr4/Makefile,v 1.3 1999/09/01 00:32:18 newton Exp $
4 # $DragonFly: src/sys/emulation/svr4/Attic/Makefile,v 1.5 2003/08/15 06:32:56 dillon Exp $
5
6 MAINTAINER=     newton@freebsd.org
7
8 # This regenerates the system calls
9 #
10 sysent: ${.CURDIR}/svr4_sysent.c
11
12 ${.CURDIR}/svr4_sysent.c ${.CURDIR}/svr4_syscall.h ${.CURDIR}/svr4_proto.h ${.CURDIR}/svr4_union.h: ${.CURDIR}/../../kern/makesyscalls.sh \
13                 ${.CURDIR}/syscalls.master ${.CURDIR}/syscalls.conf
14         -mv -f ${.CURDIR}/svr4_sysent.c ${.CURDIR}/svr4_sysent.c.bak
15         -mv -f ${.CURDIR}/svr4_syscall.h ${.CURDIR}/svr4_syscall.h.bak
16         -mv -f ${.CURDIR}/svr4_proto.h ${.CURDIR}/svr4_proto.h.bak
17         -mv -f ${.CURDIR}/svr4_union.h ${.CURDIR}/svr4_union.h.bak
18         cd ${.CURDIR} && sh ../../kern/makesyscalls.sh syscalls.master syscalls.conf
19
20 # This builds the module
21 #
22 MAINTAINER=     newton@FreeBSD.org
23
24 .PATH:  ${.CURDIR}/../../emulation/svr4/${MACHINE_ARCH} ${.CURDIR}/../../emulation/svr4
25 ARCH=   arch_svr4
26 KMOD=   svr4
27 SRCS=   svr4_sysent.c svr4_sysvec.c opt_compat.h opt_svr4.h opt_vmpage.h \
28         vnode_if.h imgact_svr4.c svr4_signal.c svr4_fcntl.c svr4_misc.c \
29         svr4_ioctl.c svr4_stat.c svr4_filio.c svr4_ttold.c svr4_termios.c \
30         svr4_stream.c svr4_socket.c svr4_sockio.c svr4_machdep.c \
31         svr4_resource.c svr4_ipc.c
32 OBJS=   svr4_locore.o 
33 MAN=    svr4.8
34
35 EXPORT_SYMS=_svr4_mod
36 CLEANFILES= svr4_assym.h svr4_genassym.o
37
38 svr4_assym.h:   svr4_genassym.o
39 .if exists(@)
40 svr4_assym.h:   @/kern/genassym.sh
41 .endif
42         sh @/kern/genassym.sh svr4_genassym.o > ${.TARGET}
43
44 svr4_locore.o:  svr4_locore.s svr4_assym.h
45         ${CC} -c -x assembler-with-cpp -DLOCORE ${CFLAGS} \
46                 ${.IMPSRC} -o ${.TARGET}
47
48 svr4_genassym.o:        svr4_genassym.c svr4.h @ machine ${ARCH}
49         ${CC} -c ${CFLAGS} ${.IMPSRC}
50
51 opt_compat.h:
52         echo "#define COMPAT_43 1" > opt_compat.h
53
54 opt_svr4.h:
55         touch opt_svr4.h
56 .if defined(DEBUG)
57         echo "#define DEBUG_SVR4 1" >> opt_svr4.h
58 .endif
59
60 afterinstall:
61         ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
62                 ${.CURDIR}/svr4.sh ${DESTDIR}/usr/sbin/svr4
63
64 .include <bsd.kmod.mk>