]> git.lizzy.rs Git - plan9front.git/blob - sys/src/9/port/portmkfile
kernel: cleanup makefile for $CONF.$O target
[plan9front.git] / sys / src / 9 / port / portmkfile
1 PORTFILES=`{../port/mkfilelist ../port}
2 ^($PORTFILES)\.$O:R:    ../port/\1.c
3         $CC $CFLAGS -I. ../port/$stem1.c
4
5 IPFILES=`{../port/mkfilelist ../ip}
6 ^($IPFILES)\.$O:R:      ../ip/\1.c ../ip/ip.h ../ip/ipv6.h
7         $CC $CFLAGS -I. ../ip/$stem1.c
8
9 %.$O:   %.s
10         $AS $AFLAGS $stem.s
11
12 %.$O:   %.c
13         $CC $CFLAGS $stem.c
14
15 %.acid: %.c
16         $CC $CFLAGS -a $stem.c >$stem.acid
17
18 %.acid: ../ip/%.c
19         $CC $CFLAGS -a -I.  ../ip/$stem.c >$stem.acid
20
21 %.acid: ../port/%.c
22         $CC $CFLAGS -a -I. ../port/$stem.c >$stem.acid
23
24 installall:V:
25         for(i in $CONFLIST)
26                 mk 'CONF='$i install
27
28 all:V:
29         for(i in $CONFLIST)
30                 mk 'CONF='$i
31
32 clean:V:
33         rm -f *.[$OS] *.i *.root.s *.rootc.c cfs.h fs.h conf.h *.out *.m errstr.h init.h reboot.h boot bootfs.paq
34         for(i in $CONFLIST $CRAPLIST)
35                 mk $i.clean
36
37 %.clean:V:
38         rm -f $stem.c [9bz]$stem [9bz]$stem.gz [9bz]$stem.u s[9bz]$stem boot$stem.*
39
40 nuke:V: clean
41         rm -f ../boot/libboot.a$O *.elf *.rr *.acid
42
43 %.$O:   /$objtype/include/u.h ../port/lib.h mem.h dat.h fns.h io.h ../port/error.h ../port/portdat.h ../port/portfns.h
44
45 ../port/systab.h:D:     /sys/src/libc/9syscall/sys.h ../port/mksystab
46         rc ../port/mksystab > ../port/systab.h
47
48 $CONF.$O:       $CONF.c $OBJ $LIB
49         $CC $CFLAGS '-DKERNDATE='`{date -n} $CONF.c
50
51 $CONF.c:D:      ../port/mkdevc $CONF
52         rc ../port/mkdevc $CONF > $CONF.c
53         {echo 'uchar configfile[]={'
54          xd -1x $CONF |
55                 sed -e 's/^[0-9a-f]+ //' -e 's/ ([0-9a-f][0-9a-f])/0x\1,/g'
56          echo 0,
57          echo '};'} >> $CONF.c
58
59 errstr.h:D:     ../port/mkerrstr ../port/error.h
60         rc ../port/mkerrstr > errstr.h
61
62 %.i:D:  %.out
63         {echo 'uchar '^$stem^'[]={'
64          xd -1x <$stem.out |
65                 sed -e 's/^[0-9a-f]+ //' -e 's/ ([0-9a-f][0-9a-f])/0x\1,/g'
66          echo '};'} > $target
67
68 %.db:D: main.c
69         $CC -s$stem main.c | dbfmt > $stem.db
70
71 alloc.$O ucalloc.$O devswap.$O devproc.$O:      /sys/include/pool.h
72 devmnt.$O:      /sys/include/fcall.h
73 proc.$O proc.acid:      errstr.h
74 devroot.$O:     errstr.h
75 devaudio.$O:    ../port/audioif.h
76 devaoe.$O:      ../port/sd.h /$objtype/include/ureg.h
77 devfs.$O:       ../port/sd.h /$objtype/include/ureg.h
78 devsd.$O:       ../port/sd.h /$objtype/include/ureg.h
79 sdscsi.$O:      ../port/sd.h /$objtype/include/ureg.h
80 sdaoe.$O:       ../port/sd.h /$objtype/include/ureg.h
81 trap.$O:        /$objtype/include/ureg.h
82 devproc.$O:     /$objtype/include/ureg.h
83 userinit.$O:    initcode.i
84 trap.$O:        ../port/systab.h
85 devpipe.$O:     ../port/netif.h
86 netif.$O:       ../port/netif.h
87 devuart.$O:     ../port/netif.h
88 devbridge.$O:   ../port/netif.h ../ip/ip.h ../ip/ipv6.h
89 devdtracy.$O dtracysys.$O dtracytimer.$O:       /sys/include/dtracy.h
90 devdraw.$O:     screen.h /sys/include/draw.h /sys/include/memdraw.h /sys/include/memlayer.h /sys/include/cursor.h
91 devmouse.$O:    screen.h /sys/include/draw.h /sys/include/memdraw.h /sys/include/cursor.h
92 swcursor.$O:    screen.h /sys/include/draw.h /sys/include/memdraw.h /sys/include/cursor.h
93 screen.$O:      screen.h /sys/include/draw.h /sys/include/memdraw.h /sys/include/cursor.h
94 thwack.$O:      ../port/thwack.h
95 unthwack.$O:    ../port/thwack.h
96 devsdp.$O:      ../port/thwack.h
97 portclock.$O sysproc.$O:        /sys/include/tos.h
98 devproc.$O edf.$O proc.$O:      /sys/include/trace.h
99 auth.$O devcons.$O:     /sys/include/authsrv.h
100 devcap.$O:      /sys/include/libsec.h
101 devfs.$O:       /sys/include/libsec.h
102 devsdp.$O:      /sys/include/libsec.h
103 devssl.$O:      /sys/include/libsec.h
104 devtls.$O:      /sys/include/libsec.h
105 devswap.$O:     /sys/include/libsec.h
106 random.$O:      /sys/include/libsec.h
107 devaoe.$O sdaoe.$O:     /sys/include/fis.h
108 sysproc.$O:     /sys/include/a.out.h
109 syscallfmt.$O:  /sys/src/libc/9syscall/sys.h
110 devusb.$O usbxhci.$O:   ../port/usb.h
111 devether.$O ethersink.$O:       ../port/etherif.h ../port/netif.h
112 wifi.$O:        ../port/etherif.h ../port/netif.h ../port/wifi.h /sys/include/libsec.h
113 wifi.$O:        ../ip/ip.h ../ip/ipv6.h
114 ethermii.$O:    ../port/ethermii.h