1# $MirOS: src/sys/dev/microcode/aic7xxx/Makefile,v 1.2 2005/03/06 21:27:46 tg Exp $
2# $OpenBSD: Makefile,v 1.7 2003/12/24 23:27:55 krw Exp $
3# $FreeBSD: src/sys/dev/aic7xxx/Makefile,v 1.6 1999/08/28 00:41:22 peter Exp $
4
5PROG=	aicasm
6
7CSRCS=	aicasm.c aicasm_symbol.c
8GENSRCS= aicasm_gram.c aicasm_scan.c aicasm_macro_gram.c aicasm_macro_scan.c
9
10GENHDRS=	y.tab.h
11
12SRCS=	${GENSRCS} ${CSRCS}
13CLEANFILES+= ${GENSRCS} ${GENHDRS} y.output
14DPADD+=	${LIBL}
15LDADD+=	-ll
16
17# Correct path for kernel builds
18# Don't rely on the kernel's .depend file
19.ifdef MAKESRCPATH
20.PATH: ${MAKESRCPATH}
21DEPENDFILE=
22.endif
23
24CPPFLAGS+= -I/usr/include -I.
25YFLAGS= ${.TARGET:M*macro*:S/$(.TARGET)/-p mm/} -d
26LFLAGS+= ${.TARGET:M*macro*:S/$(.TARGET)/-olex.yy.c/} ${.TARGET:M*macro*:S/$(.TARGET)/-Pmm/}
27NOMAN=	yes
28
29.ifdef DEBUG
30CFLAGS+= -DDEBUG -g
31YFLAGS+= -t
32LFLAGS+= -d
33SEQFLAGS= -l seq.lst
34.endif
35
36microcode aic7xxx_reg.h aic7xxx_seq.h: aic7xxx.seq aic7xxx.reg
37	${OBJDIR}./aicasm -I/sys ${SEQFLAGS} -r tempreg.h -o tempseq.h ${.CURDIR}/aic7xxx.seq
38	grep OpenBSD: ${.CURDIR}/aic7xxx.seq | cat - tempseq.h > aic7xxx_seq.h
39	grep OpenBSD: ${.CURDIR}/aic7xxx.reg | cat - tempreg.h > aic7xxx_reg.h
40	mv aic7xxx_seq.h /sys/dev/microcode/aic7xxx/
41.ifdef DEBUG
42	mv seq.lst /sys/dev/microcode/aic7xxx/
43.endif
44	mv aic7xxx_reg.h /sys/dev/microcode/aic7xxx/
45	rm -f tempseq.h tempreg.h
46
47.include <bsd.prog.mk>
48