From 6fdc46cb80bf198e299d8d645a33064a9cfe7991 Mon Sep 17 00:00:00 2001
From: Patrick Robbe <robbe@lal.in2p3.fr>
Date: Tue, 11 Jun 2019 18:53:19 +0900
Subject: [PATCH] New structure

---
 Pcie40Driver/Makefile | 44 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 44 insertions(+)
 create mode 100644 Pcie40Driver/Makefile

diff --git a/Pcie40Driver/Makefile b/Pcie40Driver/Makefile
new file mode 100644
index 0000000..ca21d80
--- /dev/null
+++ b/Pcie40Driver/Makefile
@@ -0,0 +1,44 @@
+# Makefile for 2.6+ kernels
+#
+# Will compile and install for other kernel than the currently running,
+# given the TARGET parameter (should be the name of a directory in
+# /lib/modules) e.g.
+# make TARGET=2.6.32.10-90.fc12.x86_64
+#
+DAQ40_VER_REL ?=local-wip
+ifneq ($(KERNELRELEASE),)
+obj-m :=pcie40.o
+pcie40-y :=pcie40_driver_common.o main.o ecs.o daq.o
+ccflags-y :=-DDAQ40_VER_REL=\"$(DAQ40_VER_REL)\"
+else
+ifeq ($(TARGET),)
+TARGET :=$(shell uname -r)
+endif
+PWD :=$(shell pwd)
+KDIR :=/lib/modules/$(TARGET)/build
+
+default:
+	@echo $(TARGET) > module.target
+	$(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules
+
+default: pcie40_dma_regmap.h pcie40_ioctl.h pcie40_driver_common.h pcie40_driver_common.c ecs.h daq.h
+
+default: main.c ecs.c daq.c
+
+clean:
+	@rm -f *.ko *.o .*.cmd modules.order Module.symvers *.mod.? .pcie40.* *~ *.unsigned
+	@rm -rf .tmp_versions module.target
+
+install: pcie40.ko
+	install --mode 0755 -d /lib/modules/$(shell cat module.target)/extra
+	install --mode 0644 pcie40.ko /lib/modules/$(shell cat module.target)/extra
+	/sbin/depmod -a $(shell cat module.target)
+
+pcie40.ko:
+	$(MAKE)
+
+ifneq ("$(wildcard pcie40_dma_regmap.cfg)","")
+pcie40_dma_regmap.h: pcie40_dma_regmap.cfg
+	regmap_cfg_to_h.tcl P40_ $< > $@ 2> /dev/null
+endif
+endif
-- 
GitLab