Makefile.am 3.06 KB
Newer Older
julien.delange's avatar
julien.delange committed
1
2
3
AUTOMAKE_OPTIONS = no-dependencies

C_FILES =   $(srcdir)/1553.c       \
4
5
6
	    $(srcdir)/ip.c         \
	    $(srcdir)/serial.c     \
	    $(srcdir)/spacewire.c
julien.delange's avatar
julien.delange committed
7

8
ASN_FILES = $(srcdir)/1553.asn       \
9
10
11
	    $(srcdir)/ip.asn         \
	    $(srcdir)/serial.asn     \
	    $(srcdir)/spacewire.asn
12
13


julien.delange's avatar
julien.delange committed
14
15
csrc = ${shell $(CYGPATH_U) '$(OCARINA_RUNTIME)/polyorb-hi-c/src/drivers/configuration'}

16
17
18
19
t:
	echo $(shell shell which asn1.exe)
	echo `shell which asn1.exe`

julien.delange's avatar
julien.delange committed
20
$(srcdir)/1553.c:
21
	mono $(shell which asn1.exe) -c -typePrefix __po_hi_c_ 1553.asn
22
23
	sed -e 's/Mil\_1553\_Conf\_T/mil\_1553\_conf\_t/g' 1553.h > 1553new.h
	mv 1553new.h 1553.h
24
25
26
	echo "#if (defined (__PO_HI_NEED_DRIVER_1553_RASTA))\n" > 1553new.c
	sed -e 's/Mil\_1553\_Conf\_T/mil\_1553\_conf\_t/g' 1553.c >> 1553new.c
	echo "\n#endif" >> 1553new.c
27
	mv 1553new.c 1553.c
julien.delange's avatar
julien.delange committed
28
29
30
31
	mv 1553.h ../../../include/drivers/configuration/
	mv asn1crt.h ../../../include/drivers/configuration/

$(srcdir)/spacewire.c:
32
	mono $(shell which asn1.exe) -c -typePrefix __po_hi_c_ spacewire.asn
33
34
	sed -e 's/Spacewire\_Conf\_T/spacewire\_conf\_t/g' spacewire.h > spacewirenew.h
	mv spacewirenew.h spacewire.h
35
36
37
	echo "#if (defined (__PO_HI_NEED_DRIVER_SPACEWIRE_RASTA))\n" > spacewirenew.c
	sed -e 's/Spacewire\_Conf\_T/spacewire\_conf\_t/g' spacewire.c >> spacewirenew.c
	echo "\n#endif" >> spacewirenew.c
38
	mv spacewirenew.c spacewire.c
julien.delange's avatar
julien.delange committed
39
40
41
42
	mv spacewire.h ../../../include/drivers/configuration/
	mv asn1crt.h ../../../include/drivers/configuration/

$(srcdir)/ip.c:
43
	mono $(shell which asn1.exe) -c -typePrefix __po_hi_c_ ip.asn
julien.delange's avatar
julien.delange committed
44
	mv asn1crt.h ../../../include/drivers/configuration/
45
46
	sed -e 's/IP\_Conf\_T/ip\_conf\_t/g' ip.h > ipnew.h
	mv ipnew.h ip.h
47
48
49
	echo "#if (defined (__PO_HI_NEED_DRIVER_SOCKETS) || defined (__PO_HI_NEED_DRIVER_RTEMS_NE2000_SOCKETS))\n" > ipnew.c
	sed -e 's/IP\_Conf\_T/ip\_conf\_t/g' ip.c >> ipnew.c
	echo "\n#endif" >> ipnew.c
50
51
	mv ipnew.c ip.c
	mv ip.h ../../../include/drivers/configuration/
julien.delange's avatar
julien.delange committed
52
53

$(srcdir)/serial.c:
54
	mono $(shell which asn1.exe) -c -typePrefix __po_hi_c_ serial.asn
55
56
	sed -e 's/Serial\_Conf\_T/serial\_conf\_t/g' serial.h > serialnew.h
	mv serialnew.h serial.h
57
58
59
	echo "#if (defined (__PO_HI_NEED_DRIVER_SERIAL_LINUX) || defined (__PO_HI_NEED_DRIVER_SERIAL_LINUX_RECEIVER) || defined (__PO_HI_NEED_DRIVER_SERIAL_LINUX_SENDER) || defined (__PO_HI_NEED_DRIVER_SERIAL_RASTA) || defined (__PO_HI_NEED_DRIVER_SERIAL_LEON) || defined (__PO_HI_NEED_DRIVER_SERIAL_LEON_SENDER) || defined (__PO_HI_NEED_DRIVER_SERIAL_LEON_RECEIVER))\n" > serialnew.c
	sed -e 's/Serial\_Conf\_T/serial\_conf\_t/g' serial.c >> serialnew.c
	echo "\n#endif" >> serialnew.c
60
	mv serialnew.c serial.c
julien.delange's avatar
julien.delange committed
61
62
63
64
65
66
67
	mv serial.h ../../../include/drivers/configuration/
	mv asn1crt.h ../../../include/drivers/configuration/

regenerate:
	rm -f $(C_FILES)
	for v in $(C_FILES); do $(MAKE) $$v ; done

julien.delange's avatar
julien.delange committed
68
install-data-local: $(C_FILES) $(ASN_FILES)
julien.delange's avatar
julien.delange committed
69
70
	$(INSTALL) -d $(DESTDIR)$(csrc)
	for f in $(C_FILES); do $(INSTALL) -m 444 $$f $(DESTDIR)$(csrc) ; done
71
	for f in $(ASN_FILES); do $(INSTALL) -m 444 $$f $(DESTDIR)$(csrc) ; done
julien.delange's avatar
julien.delange committed
72
73
74
75

uninstall-local:
	rm -rf $(DESTDIR)$(csrc)

76
EXTRA_DIST = $(C_FILES) $(ASN_FILES)
julien.delange's avatar
julien.delange committed
77

78
CLEANFILES = *~