1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97
|
Description: Fix the build system
Author: Simon Richter <sjr@debian.org>
Last-Update: 2013-04-04
Index: langford-0.0.20130228/Makefile
===================================================================
--- langford-0.0.20130228.orig/Makefile
+++ langford-0.0.20130228/Makefile
@@ -1,33 +1,11 @@
obj-m = langford.o
KVERSION = $(shell uname -r)
-all: langford.ko langford_util langford_adc_util
+all: libs langford_util langford_adc_util
langford.ko: langford.c
export CCFLAGS="-ansi -Wall"
- sudo make -C /lib/modules/$(KVERSION)/build M=$(PWD) modules
-
-install: langford.ko langford_util langford_adc_util
- #Ensure module recompilation everytime it needs to be installed.
- #(Prevents module version errors after kernel upgrades.)
- -sudo rm -f langford.ko
- -sudo rm -rf /dev/langford
- -sudo modprobe -r langford
- make langford.ko
- sudo cp langford.ko /lib/modules/`uname -r`/kernel/drivers/misc
- sudo depmod -a
- sudo modprobe langford
-#Allow some time for driver to finish loading. If driver does not complete loading, no character device will be registered and mknod will fail.
- sleep 3
- sync
- sudo cp langford_util /usr/bin
- sudo cp langford_adc_util /usr/bin
- sudo cp langford_init /usr/bin
-#Create langford group, if not already.
- -sudo groupadd langford
- sudo chmod a+rx /usr/bin/langford_util
- make -C libs/ install
- echo "Remember to run langford_init in order to initialize the device at /dev/langford"
+ $(MAKE) -C /lib/modules/$(KVERSION)/build M=$(PWD) modules
langford_util: langford_util.cpp
$(CXX) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) -o $@ $^
@@ -36,23 +14,16 @@ langford_adc_util: langford_adc_util.cpp
$(CXX) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) -o $@ $^
libs:
- make -f libs/Makefile
+ $(MAKE) -C libs/
clean:
- -sudo make -C /lib/modules/$(KVERSION)/build M=$(PWD) clean
- -sudo rm -rf langford.ko.gz langford_util langford_adc_util
- make -C libs/ clean
+ #$(MAKE) -C /lib/modules/$(KVERSION)/build M=$(PWD) clean
+ $(RM) -r langford.ko.gz langford_util langford_adc_util
+ $(MAKE) -C libs/ clean
distclean: clean
- -sudo make -C ./ clean
- -sudo rm -rf .tmp*
- -sudo rm -rf *~
- #-sudo rm modules.order Module.symvers
-
-uninstall:
- -sudo rm /usr/bin/langford_util
- -sudo rm /usr/bin/langford_init
- -sudo rm /usr/bin/langford_adc_util
- # Remove langford group
- -sudo groupdel langford
- make -C libs/ uninstall
+ $(MAKE) -C ./ clean
+ $(RM) -r .tmp*
+ $(RM) -r *~
+
+.PHONY: all libs clean distclean
Index: langford-0.0.20130228/libs/Makefile
===================================================================
--- langford-0.0.20130228.orig/libs/Makefile
+++ langford-0.0.20130228/libs/Makefile
@@ -10,13 +10,6 @@ langford_rf_fsynth: $(FSYNTHSRC)
langford_rx_rf_bb_vga: $(VGASRC)
$(CXX) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) -o $@ $^
-install: langford_rf_fsynth langford_rx_rf_bb_vga
- sudo cp langford_rx_rf_bb_vga langford_rf_fsynth /usr/bin
- sudo chmod a+rx /usr/bin/langford_rx_rf_bb_vga /usr/bin/langford_rf_fsynth
-
-uninstall:
- -sudo rm -rf /usr/bin/langford_rx_rf_bb_vga /usr/bin/langford_rf_fsynth
-
-clean:
- -sudo rm -rf langford_rf_fsynth langford_rx_rf_bb_vga
+clean distclean:
+ $(RM) langford_rf_fsynth langford_rx_rf_bb_vga
|