1# File: drivers/atm/Makefile
2#
3# Makefile for the Linux network (ATM) device drivers.
4#
5
6O_TARGET := atm.o
7
8export-objs := uPD98402.o suni.o idt77105.o
9
10obj-y := atmdev_init.o
11
12obj-$(CONFIG_ATM_ENI) += eni.o suni.o
13obj-$(CONFIG_ATM_ZATM) += zatm.o uPD98402.o
14obj-$(CONFIG_ATM_NICSTAR) += nicstar.o
15obj-$(CONFIG_ATM_IDT77252) += idt77252.o
16
17ifeq ($(CONFIG_ATM_NICSTAR_USE_SUNI),y)
18  obj-$(CONFIG_ATM_NICSTAR) += suni.o
19endif
20
21ifeq ($(CONFIG_ATM_NICSTAR_USE_IDT77105),y)
22  obj-$(CONFIG_ATM_NICSTAR) += idt77105.o
23endif
24
25ifeq ($(CONFIG_ATM_IDT77252_USE_SUNI),y)
26  obj-$(CONFIG_ATM_IDT77252) += suni.o
27endif
28
29obj-$(CONFIG_ATM_HORIZON) += horizon.o
30obj-$(CONFIG_ATM_AMBASSADOR) += ambassador.o
31obj-$(CONFIG_ATM_TCP) += atmtcp.o
32obj-$(CONFIG_ATM_IA) += iphase.o suni.o
33obj-$(CONFIG_ATM_FIRESTREAM) += firestream.o
34obj-$(CONFIG_ATM_LANAI) += lanai.o
35
36ifeq ($(CONFIG_ATM_FORE200E_PCA),y)
37  FORE200E_FW_OBJS += fore200e_pca_fw.o
38  ifeq ($(strip $(CONFIG_ATM_FORE200E_PCA_FW)),"")
39    CONFIG_ATM_FORE200E_PCA_DEFAULT_FW := y
40  endif
41  ifeq ($(CONFIG_ATM_FORE200E_PCA_DEFAULT_FW),y)
42#   guess the target endianess to choose the right PCA-200E firmware image
43    CONFIG_ATM_FORE200E_PCA_FW := $(shell if test -n "`$(CC) -E -dM ../../include/asm/byteorder.h | grep ' __LITTLE_ENDIAN '`"; then echo pca200e.bin; else echo pca200e_ecd.bin2; fi)
44  endif
45endif
46ifeq ($(CONFIG_ATM_FORE200E_SBA),y)
47  FORE200E_FW_OBJS += fore200e_sba_fw.o
48  ifeq ($(strip $(CONFIG_ATM_FORE200E_SBA_FW)),"")
49    CONFIG_ATM_FORE200E_SBA_DEFAULT_FW := y
50  endif
51  ifeq ($(CONFIG_ATM_FORE200E_SBA_DEFAULT_FW),y)
52    CONFIG_ATM_FORE200E_SBA_FW := sba200e_ecd.bin2
53  endif
54endif
55obj-$(CONFIG_ATM_FORE200E) += fore_200e.o
56
57obj-$(CONFIG_ATM_HE)		+= he.o
58ifeq ($(CONFIG_ATM_HE_USE_SUNI),y)
59  obj-$(CONFIG_ATM_HE)		+= suni.o
60endif
61
62list-multi	:= fore_200e.o
63fore_200e-objs	:= fore200e.o $(FORE200E_FW_OBJS)
64
65include $(TOPDIR)/Rules.make
66
67
68# FORE Systems 200E-series firmware magic
69fore200e_pca_fw.c: $(patsubst "%", %, $(CONFIG_ATM_FORE200E_PCA_FW)) \
70	  fore200e_mkfirm
71	./fore200e_mkfirm -k -b _fore200e_pca_fw \
72	  -i $(CONFIG_ATM_FORE200E_PCA_FW) -o $@
73	@ ( \
74	  echo 'ifeq ($(strip $(CONFIG_ATM_FORE200E_PCA_FW)), $$(CONFIG_ATM_FORE200E_PCA_FW))'; \
75	  echo 'FORE200E_FW_UP_TO_DATE += $@'; \
76	  echo 'endif' \
77	) >.$@.fw
78
79fore200e_sba_fw.c: $(patsubst "%", %, $(CONFIG_ATM_FORE200E_SBA_FW)) \
80	  fore200e_mkfirm
81	./fore200e_mkfirm -k -b _fore200e_sba_fw \
82	  -i $(CONFIG_ATM_FORE200E_SBA_FW) -o $@
83	@ ( \
84	  echo 'ifeq ($(strip $(CONFIG_ATM_FORE200E_SBA_FW)), $$(CONFIG_ATM_FORE200E_SBA_FW))'; \
85	  echo 'FORE200E_FW_UP_TO_DATE += $@'; \
86	  echo 'endif' \
87	) >.$@.fw
88
89fore200e_mkfirm: fore200e_mkfirm.c
90	$(HOSTCC) $(HOSTCFLAGS) $< -o $@
91
92# deal with the various suffixes of the binary firmware images
93%.bin %.bin1 %.bin2: %.data
94	objcopy -Iihex $< -Obinary $@.gz
95	gzip -n -df $@.gz
96
97fore_200e.o: $(fore_200e-objs)
98	$(LD) -r -o $@ $(fore_200e-objs)
99
100# firmware dependency stuff taken from drivers/sound/Makefile
101FORE200E_FW_UP_TO_DATE :=
102
103FORE200E_FW_FILES := $(wildcard .fore200e_*.fw)
104ifneq ($(FORE200E_FW_FILES),)
105include $(FORE200E_FW_FILES)
106endif
107
108FORE200E_FW_CHANGED := $(filter-out $(FORE200E_FW_UP_TO_DATE), \
109                       fore200e_pca_fw.c fore200e_sba_fw.c)
110
111ifneq ($(FORE200E_FW_CHANGED),)
112$(FORE200E_FW_CHANGED): dummy
113endif
114