Make dpif_close() accept a null pointer.
[sliver-openvswitch.git] / datapath / linux-2.4 / Makefile.main.in
1 # -*- makefile -*-
2 builddir = @abs_builddir@
3 srcdir = @abs_srcdir@
4 top_srcdir = @abs_top_srcdir@
5 KSRC = @KSRC24@
6 VERSION = @VERSION@
7 AC_CC = @CC@
8 KARCH = @KARCH@
9
10 # File Lists
11 include $(srcdir)/../Modules.mk
12 include $(srcdir)/Modules.mk
13 include @HW_TABLES@
14
15 default: $(all_links)
16 $(foreach m,$(all_modules), \
17   $(foreach s,$($(m)_sources), \
18     $(eval $(notdir $(s)): ; ln -s $(srcdir)/../$(s) .)))
19
20 distclean: clean
21 distdir: clean
22 install:
23 all: default
24 check: all
25 clean:
26         rm -f *.o *_mod.o .*.o.flags
27         for d in $(all_links); do if test -h $$d; then rm $$d; fi; done
28
29 ifneq (,$(KSRC))
30
31 ifneq ($(shell grep -c 'PATCHLEVEL = 4' $(KSRC)/Makefile),1)
32   $(error Linux kernel source in $(KSRC) not 2.4)
33 endif
34
35 ifeq (/lib/modules/$(shell uname -r)/source, $(KSRC))
36   KOBJ :=  /lib/modules/$(shell uname -r)/build
37 else
38   KOBJ :=  $(KSRC)
39 endif
40
41 VERSION_FILE := $(KOBJ)/include/linux/version.h
42 ifeq (,$(wildcard $(VERSION_FILE)))
43   $(error Linux kernel source not configured - missing version.h)
44 endif
45
46 CONFIG_FILE  := $(KSRC)/include/linux/autoconf.h
47 ifeq (,$(wildcard $(CONFIG_FILE)))
48   $(error Linux kernel source not configured - missing autoconf.h)
49 endif
50
51 # Determine the Cross-compile string for the kernel, which should just be the
52 # c compiler with 'gcc' removed from the end. We're obviously assuming gcc
53 # here.
54 CROSS_COMPILE = $(shell echo $(AC_CC) | perl -p -e 's/(.*)gcc.*/$$1/')
55
56 # Determine if we want to override the ARCH for the kernel
57 ifneq (,$(KARCH))
58         ARCH_OVERRIDE := ARCH=$(KARCH)
59 else
60         ARCH_OVERRIDE :=
61 endif
62
63 .PHONY: all distclean distdir clean check
64
65 # Invoke the kernel build system
66 all:
67         $(MAKE) -C $(KSRC) $(ARCH_OVERRIDE) CROSS_COMPILE=$(CROSS_COMPILE) SUBDIRS=$(PWD) modules
68
69 endif # (,$(KSRC))