Commit d6e9ee92e890f67594ab150689510df361133ead
1 parent
f5acb9fd9b
Exists in
master
and in
54 other branches
common: Move conditional compilation to Makefile
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Showing 21 changed files with 23 additions and 103 deletions Side-by-side Diff
- common/ACEX1K.c
- common/Makefile
- common/altera.c
- common/bedbug.c
- common/cmd_onenand.c
- common/cyclon2.c
- common/docecc.c
- common/fpga.c
- common/lcd.c
- common/lynxkdi.c
- common/miiphybb.c
- common/soft_i2c.c
- common/soft_spi.c
- common/spartan2.c
- common/spartan3.c
- common/stratixII.c
- common/usb.c
- common/usb_kbd.c
- common/usb_storage.c
- common/virtex2.c
- common/xilinx.c
common/ACEX1K.c
... | ... | @@ -28,8 +28,6 @@ |
28 | 28 | #include <common.h> /* core U-Boot definitions */ |
29 | 29 | #include <ACEX1K.h> /* ACEX device family */ |
30 | 30 | |
31 | -#if defined(CONFIG_FPGA) && defined(CONFIG_FPGA_ALTERA) && defined(CONFIG_FPGA_ACEX1K) | |
32 | - | |
33 | 31 | /* Define FPGA_DEBUG to get debug printf's */ |
34 | 32 | #ifdef FPGA_DEBUG |
35 | 33 | #define PRINTF(fmt,args...) printf (fmt ,##args) |
... | ... | @@ -362,6 +360,4 @@ |
362 | 360 | return ret_val; |
363 | 361 | |
364 | 362 | } |
365 | - | |
366 | -#endif /* CONFIG_FPGA && CONFIG_FPGA_ALTERA && CONFIG_FPGA_ACEX1K */ |
common/Makefile
... | ... | @@ -28,9 +28,7 @@ |
28 | 28 | AOBJS = |
29 | 29 | |
30 | 30 | COBJS-y += main.o |
31 | -COBJS-y += ACEX1K.o | |
32 | -COBJS-y += altera.o | |
33 | -COBJS-y += bedbug.o | |
31 | +COBJS-$(CONFIG_CMD_BEDBUG) += bedbug.o | |
34 | 32 | COBJS-y += circbuf.o |
35 | 33 | COBJS-$(CONFIG_CMD_AMBAPP) += cmd_ambapp.o |
36 | 34 | COBJS-y += cmd_autoscript.o |
37 | 35 | |
38 | 36 | |
... | ... | @@ -64,8 +62,19 @@ |
64 | 62 | COBJS-$(CONFIG_CMD_FDOS) += cmd_fdos.o |
65 | 63 | COBJS-$(CONFIG_CMD_FLASH) += cmd_flash.o |
66 | 64 | ifdef CONFIG_FPGA |
65 | +COBJS-y += fpga.o | |
67 | 66 | COBJS-$(CONFIG_CMD_FPGA) += cmd_fpga.o |
67 | +COBJS-$(CONFIG_FPGA_SPARTAN2) += spartan2.o | |
68 | +COBJS-$(CONFIG_FPGA_SPARTAN3) += spartan3.o | |
69 | +COBJS-$(CONFIG_FPGA_VIRTEX2) += virtex2.o | |
70 | +COBJS-$(CONFIG_FPGA_XILINX) += xilinx.o | |
71 | +ifdef CONFIG_FPGA_ALTERA | |
72 | +COBJS-y += altera.o | |
73 | +COBJS-$(CONFIG_FPGA_ACEX1K) += ACEX1K.o | |
74 | +COBJS-$(CONFIG_FPGA_CYCLON2) += cyclon2.o | |
75 | +COBJS-$(CONFIG_FPGA_STRATIX_II) += stratixII.o | |
68 | 76 | endif |
77 | +endif | |
69 | 78 | COBJS-$(CONFIG_CMD_I2C) += cmd_i2c.o |
70 | 79 | COBJS-$(CONFIG_CMD_IDE) += cmd_ide.o |
71 | 80 | COBJS-$(CONFIG_CMD_IMMAP) += cmd_immap.o |
... | ... | @@ -80,7 +89,7 @@ |
80 | 89 | COBJS-y += cmd_nand.o |
81 | 90 | COBJS-$(CONFIG_CMD_NET) += cmd_net.o |
82 | 91 | COBJS-y += cmd_nvedit.o |
83 | -COBJS-y += cmd_onenand.o | |
92 | +COBJS-$(CONFIG_CMD_ONENAND) += cmd_onenand.o | |
84 | 93 | COBJS-$(CONFIG_CMD_OTP) += cmd_otp.o |
85 | 94 | ifdef CONFIG_PCI |
86 | 95 | COBJS-$(CONFIG_CMD_PCI) += cmd_pci.o |
87 | 96 | |
... | ... | @@ -102,11 +111,9 @@ |
102 | 111 | COBJS-y += cmd_vfd.o |
103 | 112 | COBJS-y += command.o |
104 | 113 | COBJS-y += console.o |
105 | -COBJS-y += cyclon2.o | |
106 | -COBJS-y += stratixII.o | |
107 | 114 | COBJS-y += devices.o |
108 | 115 | COBJS-y += dlmalloc.o |
109 | -COBJS-y += docecc.o | |
116 | +COBJS-$(CONFIG_CMD_DOC) += docecc.o | |
110 | 117 | COBJS-y += environment.o |
111 | 118 | COBJS-y += env_common.o |
112 | 119 | COBJS-y += env_nand.o |
113 | 120 | |
114 | 121 | |
115 | 122 | |
116 | 123 | |
117 | 124 | |
... | ... | @@ -119,26 +126,23 @@ |
119 | 126 | COBJS-y += env_nowhere.o |
120 | 127 | COBJS-y += exports.o |
121 | 128 | COBJS-y += flash.o |
122 | -COBJS-y += fpga.o | |
123 | 129 | COBJS-y += hush.o |
124 | 130 | COBJS-y += kgdb.o |
125 | -COBJS-y += lcd.o | |
131 | +COBJS-$(CONFIG_LCD) += lcd.o | |
126 | 132 | COBJS-y += lists.o |
127 | -COBJS-y += lynxkdi.o | |
133 | +COBJS-$(CONFIG_LYNXKDI) += lynxkdi.o | |
128 | 134 | COBJS-y += memsize.o |
129 | -COBJS-y += miiphybb.o | |
135 | +COBJS-$(CONFIG_BITBANGMII) += miiphybb.o | |
130 | 136 | COBJS-y += miiphyutil.o |
131 | 137 | COBJS-y += s_record.o |
132 | 138 | COBJS-y += serial.o |
133 | -COBJS-y += soft_i2c.o | |
134 | -COBJS-y += soft_spi.o | |
135 | -COBJS-y += spartan2.o | |
136 | -COBJS-y += spartan3.o | |
139 | +COBJS-$(CONFIG_SOFT_I2C) += soft_i2c.o | |
140 | +COBJS-$(CONFIG_SOFT_SPI) += soft_spi.o | |
141 | +ifdef CONFIG_CMD_USB | |
137 | 142 | COBJS-y += usb.o |
138 | -COBJS-y += usb_kbd.o | |
139 | -COBJS-y += usb_storage.o | |
140 | -COBJS-y += virtex2.o | |
141 | -COBJS-y += xilinx.o | |
143 | +COBJS-$(CONFIG_USB_STORAGE) += usb_storage.o | |
144 | +endif | |
145 | +COBJS-$(CONFIG_USB_KEYBOARD) += usb_kbd.o | |
142 | 146 | COBJS-y += crc16.o |
143 | 147 | COBJS-y += xyzModem.o |
144 | 148 | COBJS-y += cmd_mac.o |
common/altera.c
... | ... | @@ -41,8 +41,6 @@ |
41 | 41 | #define PRINTF(fmt,args...) |
42 | 42 | #endif |
43 | 43 | |
44 | -#if defined(CONFIG_FPGA) && defined(CONFIG_FPGA_ALTERA) | |
45 | - | |
46 | 44 | /* Local Static Functions */ |
47 | 45 | static int altera_validate (Altera_desc * desc, const char *fn); |
48 | 46 | |
... | ... | @@ -283,6 +281,4 @@ |
283 | 281 | } |
284 | 282 | |
285 | 283 | /* ------------------------------------------------------------------------- */ |
286 | - | |
287 | -#endif /* CONFIG_FPGA & CONFIG_FPGA_ALTERA */ |
common/bedbug.c
... | ... | @@ -2,8 +2,6 @@ |
2 | 2 | |
3 | 3 | #include <common.h> |
4 | 4 | |
5 | -#if defined(CONFIG_CMD_BEDBUG) | |
6 | - | |
7 | 5 | #include <linux/ctype.h> |
8 | 6 | #include <bedbug/bedbug.h> |
9 | 7 | #include <bedbug/ppc.h> |
... | ... | @@ -1252,6 +1250,4 @@ |
1252 | 1250 | * warranties of merchantability and fitness for a particular |
1253 | 1251 | * purpose. |
1254 | 1252 | */ |
1255 | - | |
1256 | -#endif |
common/cmd_onenand.c
... | ... | @@ -12,8 +12,6 @@ |
12 | 12 | #include <common.h> |
13 | 13 | #include <command.h> |
14 | 14 | |
15 | -#ifdef CONFIG_CMD_ONENAND | |
16 | - | |
17 | 15 | #include <linux/mtd/compat.h> |
18 | 16 | #include <linux/mtd/mtd.h> |
19 | 17 | #include <linux/mtd/onenand.h> |
... | ... | @@ -159,6 +157,4 @@ |
159 | 157 | "onenand block[.oob] addr block [page] [len] - " |
160 | 158 | "read data with (block [, page]) to addr" |
161 | 159 | ); |
162 | - | |
163 | -#endif /* CONFIG_CMD_ONENAND */ |
common/cyclon2.c
... | ... | @@ -27,8 +27,6 @@ |
27 | 27 | #include <altera.h> |
28 | 28 | #include <ACEX1K.h> /* ACEX device family */ |
29 | 29 | |
30 | -#if defined(CONFIG_FPGA) && defined(CONFIG_FPGA_ALTERA) && defined(CONFIG_FPGA_CYCLON2) | |
31 | - | |
32 | 30 | /* Define FPGA_DEBUG to get debug printf's */ |
33 | 31 | #ifdef FPGA_DEBUG |
34 | 32 | #define PRINTF(fmt,args...) printf (fmt ,##args) |
... | ... | @@ -301,6 +299,4 @@ |
301 | 299 | |
302 | 300 | return ret_val; |
303 | 301 | } |
304 | - | |
305 | -#endif /* CONFIG_FPGA && CONFIG_FPGA_ALTERA && CONFIG_FPGA_CYCLON2 */ |
common/docecc.c
... | ... | @@ -31,8 +31,6 @@ |
31 | 31 | #undef ECC_DEBUG |
32 | 32 | #undef PSYCHO_DEBUG |
33 | 33 | |
34 | -#if defined(CONFIG_CMD_DOC) | |
35 | - | |
36 | 34 | #include <linux/mtd/doc2000.h> |
37 | 35 | |
38 | 36 | /* need to undef it (from asm/termbits.h) */ |
... | ... | @@ -513,6 +511,4 @@ |
513 | 511 | free(Index_of); |
514 | 512 | return nb_errors; |
515 | 513 | } |
516 | - | |
517 | -#endif |
common/fpga.c
... | ... | @@ -29,8 +29,6 @@ |
29 | 29 | #include <xilinx.h> /* xilinx specific definitions */ |
30 | 30 | #include <altera.h> /* altera specific definitions */ |
31 | 31 | |
32 | -#if defined(CONFIG_FPGA) | |
33 | - | |
34 | 32 | #if 0 |
35 | 33 | #define FPGA_DEBUG /* define FPGA_DEBUG to get debug messages */ |
36 | 34 | #endif |
... | ... | @@ -335,6 +333,4 @@ |
335 | 333 | } |
336 | 334 | |
337 | 335 | /* ------------------------------------------------------------------------- */ |
338 | - | |
339 | -#endif /* CONFIG_FPGA */ |
common/lcd.c
... | ... | @@ -55,8 +55,6 @@ |
55 | 55 | #include <nand.h> |
56 | 56 | #endif |
57 | 57 | |
58 | -#ifdef CONFIG_LCD | |
59 | - | |
60 | 58 | /************************************************************************/ |
61 | 59 | /* ** FONT DATA */ |
62 | 60 | /************************************************************************/ |
... | ... | @@ -867,6 +865,4 @@ |
867 | 865 | |
868 | 866 | /************************************************************************/ |
869 | 867 | /************************************************************************/ |
870 | - | |
871 | -#endif /* CONFIG_LCD */ |
common/lynxkdi.c
... | ... | @@ -17,7 +17,6 @@ |
17 | 17 | #include <asm/processor.h> |
18 | 18 | #include <image.h> |
19 | 19 | |
20 | -#if defined(CONFIG_LYNXKDI) | |
21 | 20 | #include <lynxkdi.h> |
22 | 21 | |
23 | 22 | DECLARE_GLOBAL_DATA_PTR; |
... | ... | @@ -66,6 +65,4 @@ |
66 | 65 | #else |
67 | 66 | #error "Lynx KDI support not implemented for configured CPU" |
68 | 67 | #endif |
69 | - | |
70 | -#endif /* CONFIG_LYNXKDI */ |
common/miiphybb.c
... | ... | @@ -30,9 +30,6 @@ |
30 | 30 | #include <ioports.h> |
31 | 31 | #include <ppc_asm.tmpl> |
32 | 32 | |
33 | -#ifdef CONFIG_BITBANGMII | |
34 | - | |
35 | - | |
36 | 33 | /***************************************************************************** |
37 | 34 | * |
38 | 35 | * Utility to send the preamble, address, and register (common to read |
... | ... | @@ -236,6 +233,4 @@ |
236 | 233 | |
237 | 234 | return 0; |
238 | 235 | } |
239 | - | |
240 | -#endif /* CONFIG_BITBANGMII */ |
common/soft_i2c.c
... | ... | @@ -41,8 +41,6 @@ |
41 | 41 | #endif |
42 | 42 | #include <i2c.h> |
43 | 43 | |
44 | -#if defined(CONFIG_SOFT_I2C) | |
45 | - | |
46 | 44 | /* #define DEBUG_I2C */ |
47 | 45 | |
48 | 46 | #ifdef DEBUG_I2C |
... | ... | @@ -423,7 +421,4 @@ |
423 | 421 | { |
424 | 422 | i2c_write(i2c_addr, reg, 1, &val, 1); |
425 | 423 | } |
426 | - | |
427 | - | |
428 | -#endif /* CONFIG_SOFT_I2C */ |
common/soft_spi.c
... | ... | @@ -27,8 +27,6 @@ |
27 | 27 | #include <common.h> |
28 | 28 | #include <spi.h> |
29 | 29 | |
30 | -#if defined(CONFIG_SOFT_SPI) | |
31 | - | |
32 | 30 | #include <malloc.h> |
33 | 31 | |
34 | 32 | /*----------------------------------------------------------------------- |
... | ... | @@ -193,6 +191,4 @@ |
193 | 191 | |
194 | 192 | return(0); |
195 | 193 | } |
196 | - | |
197 | -#endif /* CONFIG_SOFT_SPI */ |
common/spartan2.c
... | ... | @@ -25,8 +25,6 @@ |
25 | 25 | #include <common.h> /* core U-Boot definitions */ |
26 | 26 | #include <spartan2.h> /* Spartan-II device family */ |
27 | 27 | |
28 | -#if defined(CONFIG_FPGA) && defined(CONFIG_FPGA_SPARTAN2) | |
29 | - | |
30 | 28 | /* Define FPGA_DEBUG to get debug printf's */ |
31 | 29 | #ifdef FPGA_DEBUG |
32 | 30 | #define PRINTF(fmt,args...) printf (fmt ,##args) |
... | ... | @@ -663,6 +661,4 @@ |
663 | 661 | return ret_val; |
664 | 662 | |
665 | 663 | } |
666 | - | |
667 | -#endif |
common/spartan3.c
... | ... | @@ -30,8 +30,6 @@ |
30 | 30 | #include <common.h> /* core U-Boot definitions */ |
31 | 31 | #include <spartan3.h> /* Spartan-II device family */ |
32 | 32 | |
33 | -#if defined(CONFIG_FPGA) && defined(CONFIG_FPGA_SPARTAN3) | |
34 | - | |
35 | 33 | /* Define FPGA_DEBUG to get debug printf's */ |
36 | 34 | #ifdef FPGA_DEBUG |
37 | 35 | #define PRINTF(fmt,args...) printf (fmt ,##args) |
... | ... | @@ -668,6 +666,4 @@ |
668 | 666 | return ret_val; |
669 | 667 | |
670 | 668 | } |
671 | - | |
672 | -#endif |
common/stratixII.c
... | ... | @@ -25,8 +25,6 @@ |
25 | 25 | #include <common.h> /* core U-Boot definitions */ |
26 | 26 | #include <altera.h> |
27 | 27 | |
28 | -#if defined(CONFIG_FPGA) && defined(CONFIG_FPGA_ALTERA) && defined(CONFIG_FPGA_STRATIX_II) | |
29 | - | |
30 | 28 | int StratixII_ps_fpp_load (Altera_desc * desc, void *buf, size_t bsize, |
31 | 29 | int isSerial, int isSecure); |
32 | 30 | int StratixII_ps_fpp_dump (Altera_desc * desc, void *buf, size_t bsize); |
... | ... | @@ -231,6 +229,4 @@ |
231 | 229 | |
232 | 230 | return FPGA_SUCCESS; |
233 | 231 | } |
234 | - | |
235 | -#endif /* defined(CONFIG_FPGA) && defined(CONFIG_FPGA_ALTERA) && defined(CONFIG_FPGA_STRATIX_II) */ |
common/usb.c
... | ... | @@ -50,8 +50,6 @@ |
50 | 50 | #include <linux/ctype.h> |
51 | 51 | #include <asm/byteorder.h> |
52 | 52 | |
53 | -#if defined(CONFIG_CMD_USB) | |
54 | - | |
55 | 53 | #include <usb.h> |
56 | 54 | #ifdef CONFIG_4xx |
57 | 55 | #include <asm/4xx_pci.h> |
... | ... | @@ -1246,8 +1244,6 @@ |
1246 | 1244 | ret=usb_hub_configure(dev); |
1247 | 1245 | return ret; |
1248 | 1246 | } |
1249 | - | |
1250 | -#endif | |
1251 | 1247 | |
1252 | 1248 | /* EOF */ |
common/usb_kbd.c
... | ... | @@ -28,8 +28,6 @@ |
28 | 28 | #include <devices.h> |
29 | 29 | #include <asm/byteorder.h> |
30 | 30 | |
31 | -#ifdef CONFIG_USB_KEYBOARD | |
32 | - | |
33 | 31 | #include <usb.h> |
34 | 32 | |
35 | 33 | #undef USB_KBD_DEBUG |
36 | 34 | |
... | ... | @@ -746,8 +744,5 @@ |
746 | 744 | |
747 | 745 | } |
748 | 746 | |
749 | - | |
750 | 747 | #endif |
751 | - | |
752 | -#endif /* CONFIG_USB_KEYBOARD */ |
common/usb_storage.c
... | ... | @@ -55,13 +55,9 @@ |
55 | 55 | #include <asm/byteorder.h> |
56 | 56 | #include <asm/processor.h> |
57 | 57 | |
58 | - | |
59 | -#if defined(CONFIG_CMD_USB) | |
60 | 58 | #include <part.h> |
61 | 59 | #include <usb.h> |
62 | 60 | |
63 | -#ifdef CONFIG_USB_STORAGE | |
64 | - | |
65 | 61 | #undef USB_STOR_DEBUG |
66 | 62 | #undef BBB_COMDAT_TRACE |
67 | 63 | #undef BBB_XPORT_TRACE |
... | ... | @@ -1242,7 +1238,4 @@ |
1242 | 1238 | USB_STOR_PRINTF("partype: %d\n",dev_desc->part_type); |
1243 | 1239 | return 1; |
1244 | 1240 | } |
1245 | - | |
1246 | -#endif /* CONFIG_USB_STORAGE */ | |
1247 | -#endif |
common/virtex2.c
... | ... | @@ -31,8 +31,6 @@ |
31 | 31 | #include <common.h> |
32 | 32 | #include <virtex2.h> |
33 | 33 | |
34 | -#if defined(CONFIG_FPGA) && defined(CONFIG_FPGA_VIRTEX2) | |
35 | - | |
36 | 34 | #if 0 |
37 | 35 | #define FPGA_DEBUG |
38 | 36 | #endif |
... | ... | @@ -552,7 +550,6 @@ |
552 | 550 | } |
553 | 551 | return ret_val; |
554 | 552 | } |
555 | -#endif | |
556 | 553 | |
557 | 554 | /* vim: set ts=4 tw=78: */ |
common/xilinx.c
... | ... | @@ -32,8 +32,6 @@ |
32 | 32 | #include <spartan2.h> |
33 | 33 | #include <spartan3.h> |
34 | 34 | |
35 | -#if defined(CONFIG_FPGA) && defined(CONFIG_FPGA_XILINX) | |
36 | - | |
37 | 35 | #if 0 |
38 | 36 | #define FPGA_DEBUG |
39 | 37 | #endif |
... | ... | @@ -307,6 +305,4 @@ |
307 | 305 | |
308 | 306 | return ret_val; |
309 | 307 | } |
310 | - | |
311 | -#endif /* CONFIG_FPGA && CONFIG_FPGA_XILINX */ |