|
1 |
| -export KMODDIR?= updates |
2 |
| -KMODDIR_ARG:= "INSTALL_MOD_DIR=$(KMODDIR)" |
3 |
| -ifneq ($(origin KLIB), undefined) |
4 |
| -KMODPATH_ARG:= "INSTALL_MOD_PATH=$(KLIB)" |
5 |
| -else |
6 |
| -export KLIB:= /lib/modules/$(shell uname -r) |
7 |
| -endif |
8 |
| -export KLIB_BUILD ?= $(KLIB)/build |
9 |
| -export MAKE |
10 |
| - |
11 |
| -DESTDIR?= |
12 |
| - |
13 |
| -ifneq ($(KERNELRELEASE),) |
14 |
| - |
15 |
| --include $(COMPAT_CONFIG) |
16 |
| -include $(COMPAT_CONFIG_CW) |
17 |
| - |
18 |
| -NOSTDINC_FLAGS := -I$(M)/include/ \ |
19 |
| - -include $(M)/include/linux/compat-2.6.h \ |
20 |
| - $(CFLAGS) |
21 |
| - |
22 |
| -obj-y := compat/ |
23 |
| - |
24 |
| - |
25 |
| -ifeq ($(BT),) |
26 |
| - |
27 |
| - |
28 |
| -obj-$(CONFIG_COMPAT_NETWORK_MODULES) += src/ |
29 |
| - |
30 |
| - |
31 |
| -ifeq ($(CONFIG_STAGING_EXCLUDE_BUILD),) |
32 |
| -endif |
33 |
| - |
34 |
| -endif |
35 |
| - |
36 |
| - |
37 |
| -else |
38 |
| - |
39 |
| -export PWD := $(shell pwd) |
40 |
| - |
41 |
| -# The build will fail if there is any space in PWD. |
42 |
| -ifneq (,$(findstring $() ,$(PWD))) |
43 |
| -$(error "The path to this compat-drivers directory has spaces in it." \ |
44 |
| - "Please put it somewhere where there is no space") |
45 |
| -endif |
46 |
| - |
47 |
| -export CFLAGS += \ |
48 |
| - -DCOMPAT_BASE="\"$(shell cat $(PWD)/.compat_base)\"" \ |
49 |
| - -DCOMPAT_BASE_TREE="\"$(shell cat $(PWD)/.compat_base_tree)\"" \ |
50 |
| - -DCOMPAT_BASE_TREE_VERSION="\"$(shell cat $(PWD)/.compat_base_tree_version)\"" \ |
51 |
| - -DCOMPAT_PROJECT="\"Compat-wireless\"" \ |
52 |
| - -DCOMPAT_VERSION="\"$(shell cat $(PWD)/.compat_version)\"" |
53 |
| - |
54 |
| -# These exported as they are used by the scripts |
55 |
| -# to check config and compat autoconf |
56 |
| -export COMPAT_CONFIG_CW=$(PWD)/config.mk |
57 |
| -export COMPAT_CONFIG=$(PWD)/.config |
58 |
| -export CONFIG_CHECK=$(PWD)/.config.mk_md5sum.txt |
59 |
| -export COMPAT_AUTOCONF=include/linux/compat_autoconf.h |
60 |
| -export CREL=$(shell cat $(PWD)/.compat_version) |
61 |
| -export CREL_PRE:=.compat_autoconf_ |
62 |
| -export CREL_CHECK:=$(PWD)/$(CREL_PRE)$(CREL) |
| 1 | +include target/linux/port.mk |
| 2 | +#include target/freebsd/port.mk |
63 | 3 |
|
64 | 4 | all: help
|
65 | 5 |
|
66 | 6 | help:
|
67 | 7 | @echo Possible build options:
|
68 | 8 | @echo
|
69 |
| - @echo make linux-src - Transforms code for integration into linux-next |
70 |
| - @echo make linux - Builds alx for any Linux kernel 2.6.28 - 3.x |
71 |
| - |
72 |
| -$(COMPAT_CONFIG): ; |
73 |
| - |
74 |
| -# Convert unified driver code to Linux, always targeting linux-next |
75 |
| -linux-src: |
76 |
| - @cp -a src target/linux/ |
77 |
| - |
78 |
| -# Uses compat-drivers to provide backport functionality |
79 |
| -# to support the linux-next driver down to all supported |
80 |
| -# compat-drivers kernels. |
81 |
| -linux: $(CREL_CHECK) |
82 |
| - @patch -p6 -d target/linux/src/ < unified-drivers/network/0001-backport-alx.patch |
83 |
| - $(MAKE) -C $(KLIB_BUILD) M=$(PWD) modules |
84 |
| - @touch $@ |
85 |
| - |
86 |
| -# We use a CREL_CHECK variable which will depend on the environment used to |
87 |
| -# build. If the environment requirements change it forces a reconfiguration |
88 |
| -# check. This means we force a new reconfiguration check if a the user gets a |
89 |
| -# new updates of compat-drivers or when the user updates the $(COMPAT_CONFIG) |
90 |
| -# file. |
91 |
| -# XXX: add kernel target to the CREL_CHECK mix, this would ensure we also |
92 |
| -# reconfigure and build again fresh if we detect a new target kernel is |
93 |
| -# being used. |
94 |
| -$(CREL_CHECK): |
95 |
| - @# Force to regenerate compat autoconf |
96 |
| - +@./compat/scripts/gen-compat-config.sh > $(COMPAT_CONFIG) |
97 |
| - @rm -f $(CONFIG_CHECK) |
98 |
| - +@./scripts/check_config.sh |
99 |
| - @md5sum $(COMPAT_CONFIG_CW) > $(CONFIG_CHECK) |
100 |
| - @touch $@ |
101 |
| - |
102 |
| -install: uninstall install-modules install-scripts |
103 |
| - |
104 |
| -install-modules: modules |
105 |
| - $(MAKE) -C $(KLIB_BUILD) M=$(PWD) $(KMODDIR_ARG) $(KMODPATH_ARG) \ |
106 |
| - modules_install |
107 |
| - @./scripts/update-initramfs |
108 |
| - |
109 |
| -install-scripts: |
110 |
| - @# All the scripts we can use |
111 |
| - @mkdir -p $(DESTDIR)/usr/lib/compat-drivers/ |
112 |
| - @install scripts/modlib.sh $(DESTDIR)/usr/lib/compat-drivers/ |
113 |
| - @# If on distributions like Mandriva which like to |
114 |
| - @# compress their modules this will find out and do |
115 |
| - @# it for you. Reason is some old version of modutils |
116 |
| - @# won't know mac80211.ko should be used instead of |
117 |
| - @# mac80211.ko.gz |
118 |
| - @./scripts/compress_modules |
119 |
| - @# Mandrake doesn't have a depmod.d/ conf file to prefer |
120 |
| - @# the updates/ dir which is what we use so we add one for it |
121 |
| - @# (or any other distribution that doens't have this). |
122 |
| - @./scripts/check_depmod |
123 |
| - @# Udev stuff needed for the new compat_firmware_class. |
124 |
| - @./compat/scripts/compat_firmware_install |
125 |
| - @/sbin/depmod -a |
126 |
| - @echo |
127 |
| - @echo Now run: |
128 |
| - @echo |
129 |
| - @echo sudo make unload to unload all: ethernet modules |
130 |
| - @echo |
131 |
| - @echo Run sudo modprobe 'driver-name' to load your desired driver. |
132 |
| - @echo If unsure reboot. |
133 |
| - @echo |
134 |
| - |
135 |
| -uninstall: |
136 |
| - @# New location, matches upstream |
137 |
| - @rm -rf $(KLIB)/$(KMODDIR)/compat/ |
138 |
| - @rm -rf $(KLIB)/$(KMODDIR)/drivers/net/ethernet/atheros/alx/alx.ko* |
139 |
| - @# Lets only remove the stuff we are sure we are providing |
140 |
| - @# on the misc directory. |
141 |
| - @/sbin/depmod -a |
142 |
| - @echo |
143 |
| - |
144 |
| -clean: |
145 |
| - $(MAKE) -C $(KLIB_BUILD) M=$(PWD) clean |
146 |
| - @rm -f $(CREL_PRE)* |
147 |
| - @rm -rf target/linux/src/ |
148 |
| -unload: |
149 |
| - @./scripts/unload.sh |
150 |
| - |
151 |
| -.PHONY: all clean install uninstall unload modules Makefile linux linux-src |
152 |
| - |
153 |
| -endif |
| 9 | + @make -s linux-help |
| 10 | + @#make -s freebsd-help |
154 | 11 |
|
155 |
| -clean-files += Module.symvers Module.markers modules modules.order |
156 |
| -clean-files += $(CREL_CHECK) $(CONFIG_CHECK) $(COMPAT_CONFIG) |
| 12 | +.PHONY: help |
0 commit comments