depmod: export static device node information to modules.devname
[mit.git] / tests / data / Makefile
blobffa19f660736e10f7a2e0c00ee0d020cf19d92ae
1 # Makefile to rebuild the test modules for a given bits-endianess combination
2 USAGE := make BITS=32|64 END=be|le [CC=..] [CFLAGS=...]
4 CC := gcc
5 CFLAGS := -Wall -DBITS_PER_LONG=$(BITS)
7 targets := \
8 alias/alias.ko \
9 complex/complex_a.ko \
10 complex/complex_b.ko \
11 complex/complex_c.ko \
12 complex/complex_d.ko \
13 complex/complex_e.ko \
14 loop/loop1.ko \
15 loop/loop2.ko \
16 loop/loop_dep.ko \
17 map/ccw_map.ko \
18 map/ieee1394_map.ko \
19 map/input_map.ko \
20 map/input_map_new.ko \
21 map/of_map.ko \
22 map/pci_map.ko \
23 map/pnp_map.ko \
24 map/usb_map.ko \
25 modinfo/modinfo.ko \
26 normal/export_dep.ko \
27 normal/export_nodep.ko \
28 normal/noexport_dep.ko \
29 normal/noexport_doubledep.ko \
30 normal/noexport_nodep.ko \
31 rename/rename-new.ko \
32 rename/rename-old.ko \
33 rename/rename-version.ko \
34 unknown/unknown.ko
36 all: check_vars build
38 check_vars:
39 @case "$(BITS)-$(END)" in \
40 32-le | 32-be | 64-le | 64-be) ;; \
41 *) \
42 echo "Usage: $(USAGE)" >&2; \
43 exit 1;; \
44 esac
46 build: $(patsubst %.ko, $(BITS)-$(END)/%-$(BITS).ko, $(targets))
48 %.ko: %.o
49 mv $^ $@
51 # FIXME - ugly
52 $(BITS)-$(END)/map/%-$(BITS).o \
53 $(BITS)-$(END)/modinfo/%-$(BITS).o \
54 $(BITS)-$(END)/rename/%-$(BITS).o \
55 $(BITS)-$(END)/normal/%-$(BITS).o \
56 $(BITS)-$(END)/unknown/%-$(BITS).o \
57 $(BITS)-$(END)/complex/%-$(BITS).o \
58 $(BITS)-$(END)/alias/%-$(BITS).o \
59 $(BITS)-$(END)/loop/%-$(BITS).o \
60 $(BITS)-$(END)/normal/%-$(BITS).o \
61 : src/%.c
62 mkdir -p $(dir $@)
63 $(CC) $(CFLAGS) -o $@ -c $^
64 @case "$(END)" in \
65 le) end2=LSB;; \
66 be) end2=MSB;; \
67 esac; \
68 desc=`file -b $@`; \
69 case "$$desc" in \
70 *\ $(BITS)-bit\ $$end2\ *) ;; \
71 *) echo "$@ does not look like a $(BITS)-$(END) object:" >&2; \
72 echo "$$desc" >&2 ; \
73 exit 1;; \
74 esac