Commit 27d09a4e authored by Federico Vaga's avatar Federico Vaga

moved kernel stuff to ./kernel/; Makefiles updated

Signed-off-by: 's avatarFederico Vaga <federico.vaga@gmail.com>
parent d387c0df
LINUX ?= /lib/modules/$(shell uname -r)/build
ZIO ?= $(HOME)/zio
SPEC_SW ?= $(HOME)/spec-sw
FMC_BUS ?= $(HOME)/fmc-bus
.PHONY: all clean modules install modules_install
.PHONY: gitmodules prereq prereq_install prereq_install_warn
KBUILD_EXTRA_SYMBOLS := $(ZIO)/Module.symvers $(SPEC_SW)/kernel/Module.symvers
DIRS = kernel tools
ccflags-y = -I$(ZIO)/include -I$(FMC_BUS)/kernel/include -I$(SPEC_SW)/kernel -I$M
all clean modules install modules_install: gitmodules
for d in $(DIRS); do $(MAKE) -C $$d $@ || exit 1; done
@if echo $@ | grep -q install; then $(MAKE) prereq_install_warn; fi
ccflags-y += -DDEBUG # temporary
all modules: prereq
subdirs-ccflags-y = $(ccflags-y)
#### The following targets are used to manage prerequisite repositories
gitmodules:
@test -d fmc-bus/doc || echo "Checking out submodules"
@test -d fmc-bus/doc || git submodule update --init
# The user can override, using environment variables, all these three:
FMC_BUS ?= fmc-bus
SPEC_SW ?= spec-sw
ZIO ?= zio
SUBMOD = $(FMC_BUS) $(SPEC_SW) $(ZIO)
obj-m := fmc-adc.o
prereq:
for d in $(SUBMOD); do $(MAKE) -C $$d || exit 1; done
fmc-adc-objs = fa-zio-drv.o
fmc-adc-objs += fa-core.o
fmc-adc-objs += fa-zio-trg.o
fmc-adc-objs += fa-dma.o
fmc-adc-objs += onewire.o
fmc-adc-objs += spi.o
prereq_install_warn:
@test -f .prereq_installed || \
echo -e "\n\n\tWARNING: Consider \"make prereq_install\"\n"
all: modules
modules_install clean modules:
$(MAKE) -C $(LINUX) M=$(shell /bin/pwd) $@
prereq_install:
for d in $(SUBMOD); do $(MAKE) -C $$d modules_install || exit 1; done
touch .prereq_installed
LINUX ?= /lib/modules/$(shell uname -r)/build
ZIO ?= $(M)/../zio
SPEC_SW ?= $(M)/../spec-sw
FMC_BUS ?= $(M)/../fmc-bus
KBUILD_EXTRA_SYMBOLS := \
$(ZIO)/Module.symvers \
$(SPEC_SW)/kernel/Module.symvers \
$(FMC_BUS)/kernel/Module.symvers
ccflags-y = \
-I$(ZIO)/include \
-I$(SPEC_SW)/kernel \
-I$(SPEC_SW)/kernel/include \
-I$(FMC_BUS)/kernel/include \
-I$M
ccflags-y += -DDEBUG # temporary
subdirs-ccflags-y = $(ccflags-y)
obj-m := fmc-adc.o
fmc-adc-objs = fa-zio-drv.o
fmc-adc-objs += fa-core.o
fmc-adc-objs += fa-zio-trg.o
fmc-adc-objs += fa-dma.o
fmc-adc-objs += onewire.o
fmc-adc-objs += spi.o
all modules:
$(MAKE) -C $(LINUX) M=$(shell /bin/pwd) modules
install modules_install:
$(MAKE) -C $(LINUX) M=$(shell /bin/pwd) modules_install
# be able to run the "clean" rule even if $(LINUX) is not valid
clean:
rm -rf *.o *~ .*.cmd *.ko *.mod.c .tmp_versions Module.symvers \
Module.markers modules.order
......@@ -9,7 +9,7 @@ hostprogs-y += fau-acq-time
hostprogs-y += parport-burst
# we are not in the kernel, so we need to piggy-back on "make modules"
modules: $(hostprogs-y)
all modules: $(hostprogs-y)
clean:
rm -f $(hostprogs-y) *.o *~
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment