diff options
Diffstat (limited to 'languages/cpp/app_templates/kmod')
-rw-r--r-- | languages/cpp/app_templates/kmod/.kdev_ignore | 0 | ||||
-rw-r--r-- | languages/cpp/app_templates/kmod/Makefile.am | 17 | ||||
-rw-r--r-- | languages/cpp/app_templates/kmod/kmod-driver.c | 22 | ||||
-rw-r--r-- | languages/cpp/app_templates/kmod/kmod.kdevelop | 93 | ||||
-rw-r--r-- | languages/cpp/app_templates/kmod/kmod.kdevtemplate | 89 | ||||
-rw-r--r-- | languages/cpp/app_templates/kmod/kmod.png | bin | 0 -> 483 bytes | |||
-rw-r--r-- | languages/cpp/app_templates/kmod/src-Makefile | 30 |
7 files changed, 251 insertions, 0 deletions
diff --git a/languages/cpp/app_templates/kmod/.kdev_ignore b/languages/cpp/app_templates/kmod/.kdev_ignore new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/languages/cpp/app_templates/kmod/.kdev_ignore diff --git a/languages/cpp/app_templates/kmod/Makefile.am b/languages/cpp/app_templates/kmod/Makefile.am new file mode 100644 index 00000000..76afcd5a --- /dev/null +++ b/languages/cpp/app_templates/kmod/Makefile.am @@ -0,0 +1,17 @@ +dataFiles = src-Makefile kmod.kdevelop kmod-driver.c + +templateName = kmod + +### no need to change below: +template_DATA = $(templateName).kdevtemplate +templatedir = ${appwizarddatadir}/templates + +appwizarddatadir = ${kde_datadir}/kdevappwizard +$(templateName).tar.gz: ${dataFiles} + $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles} + $(GZIP_COMMAND) -f9 $(templateName).tar + +archivedir = ${appwizarddatadir} +archive_DATA = $(templateName).tar.gz ${templateName}.png + +CLEANFILES = *.tar.gz
\ No newline at end of file diff --git a/languages/cpp/app_templates/kmod/kmod-driver.c b/languages/cpp/app_templates/kmod/kmod-driver.c new file mode 100644 index 00000000..5ddc7ce6 --- /dev/null +++ b/languages/cpp/app_templates/kmod/kmod-driver.c @@ -0,0 +1,22 @@ + +#include <linux/kernel.h> +#include <linux/init.h> +#include <linux/module.h> + +MODULE_DESCRIPTION("My kernel module"); +MODULE_AUTHOR("%{AUTHOR} (%{EMAIL})"); +MODULE_LICENSE("$LICENSE$"); + +static int %{APPNAMELC}_init_module(void) +{ + printk( KERN_DEBUG "Module %{APPNAME} init\n" ); + return 0; +} + +static void %{APPNAMELC}_exit_module(void) +{ + printk( KERN_DEBUG "Module %{APPNAME} exit\n" ); +} + +module_init(%{APPNAMELC}_init_module); +module_exit(%{APPNAMELC}_exit_module); diff --git a/languages/cpp/app_templates/kmod/kmod.kdevelop b/languages/cpp/app_templates/kmod/kmod.kdevelop new file mode 100644 index 00000000..93c6c0f4 --- /dev/null +++ b/languages/cpp/app_templates/kmod/kmod.kdevelop @@ -0,0 +1,93 @@ +<?xml version="1.0"?> +<kdevelop> + <general> + <author>%{AUTHOR}</author> + <email>%{EMAIL}</email> + <version>%{VERSION}</version> + <projectmanagement>KDevCustomProject</projectmanagement> + <primarylanguage>C</primarylanguage> + <ignoreparts> + <part>KDevDebugger</part> + </ignoreparts> + <keywords> + <keyword>C</keyword> + <keyword>Linux</keyword> + <keyword>Kernel</keyword> + </keywords> + </general> + <kdevfileview> + <groups> + <group pattern="Makefile" name="Build" /> + <group pattern="*.c" name="Source" /> + </groups> + </kdevfileview> + <kdevcustomproject> + <envvars/> + <build> + <buildtool>make</buildtool> + <builddir/> + </build> + <make> + <abortonerror>true</abortonerror> + <numberofjobs>1</numberofjobs> + <dontact>false</dontact> + <makebin/> + <envvars/> + </make> + <makeenvvars/> + </kdevcustomproject> + <kdevdoctreeview> + <ignoretocs> + <toc>ada</toc> + <toc>ada_bugs_gcc</toc> + <toc>bash</toc> + <toc>bash_bugs</toc> + <toc>clanlib</toc> + <toc>w3c-dom-level2-html</toc> + <toc>fortran_bugs_gcc</toc> + <toc>gnome1</toc> + <toc>gnustep</toc> + <toc>gtk</toc> + <toc>gtk_bugs</toc> + <toc>haskell</toc> + <toc>haskell_bugs_ghc</toc> + <toc>java_bugs_gcc</toc> + <toc>java_bugs_sun</toc> + <toc>kde2book</toc> + <toc>libstdc++</toc> + <toc>opengl</toc> + <toc>pascal_bugs_fp</toc> + <toc>php</toc> + <toc>php_bugs</toc> + <toc>perl</toc> + <toc>perl_bugs</toc> + <toc>python</toc> + <toc>python_bugs</toc> + <toc>qt-kdev3</toc> + <toc>ruby</toc> + <toc>ruby_bugs</toc> + <toc>sdl</toc> + <toc>stl</toc> + <toc>w3c-svg</toc> + <toc>sw</toc> + <toc>w3c-uaag10</toc> + <toc>wxwidgets_bugs</toc> + </ignoretocs> + <ignoreqt_xml> + <toc>Guide to the Qt Translation Tools</toc> + <toc>Qt Assistant Manual</toc> + <toc>Qt Designer Manual</toc> + <toc>Qt Reference Documentation</toc> + <toc>qmake User Guide</toc> + </ignoreqt_xml> + <ignoredoxygen> + <toc>KDE Libraries (Doxygen)</toc> + </ignoredoxygen> + </kdevdoctreeview> + <kdevdocumentation> + <projectdoc> + <docsystem>Doxygen Documentation Collection</docsystem> + <docurl>%{APPNAMELC}.tag</docurl> + </projectdoc> + </kdevdocumentation> +</kdevelop> diff --git a/languages/cpp/app_templates/kmod/kmod.kdevtemplate b/languages/cpp/app_templates/kmod/kmod.kdevtemplate new file mode 100644 index 00000000..03a335cd --- /dev/null +++ b/languages/cpp/app_templates/kmod/kmod.kdevtemplate @@ -0,0 +1,89 @@ +# KDE Config File +[General] +Name=Linux Kernel module +Name[br]=Mollad ar galon Linux +Name[ca]=Mòdul del nucli Linux +Name[da]=Linux kernemodul +Name[de]=Linux-Kernelmodul +Name[el]=Άρθρωμα πυρήνα Linux +Name[es]=Módulo para el núcleo de Linux +Name[et]=Linuxi kerneli moodul +Name[eu]=Linux Kernel modulua +Name[fa]=پیمانۀ هستۀ لینوکس +Name[fr]=Module de noyau Linux +Name[ga]=Modúl Eithne Linux +Name[gl]=Módulo para o kernel Linux +Name[hu]=Linuxos kernelmodul +Name[it]=Modulo del kernel Linux +Name[ja]=Linux カーネルモジュール +Name[nds]=Linux-Kernelmoduul +Name[ne]=लिनक्स कर्नेल मोड्युल +Name[nl]=Linux kernelmodule +Name[pl]=Moduł jądra Linuksa +Name[pt]=Módulo do 'kernel' do Linux +Name[pt_BR]=Módulo do 'kernel' do Linux +Name[ru]=Драйвер ядра Linux +Name[sk]=Linux kernel modul +Name[sr]=Модул језгра Linux-а +Name[sr@Latn]=Modul jezgra Linux-a +Name[sv]=Modul för Linux kärna +Name[tr]=Linux Çekirdek Birimi +Name[zh_CN]=Linux 内核模块 +Name[zh_TW]=Linux 核心模組 +Icon= +Category=C +Comment=Generates a template for a Linux kernel module. +Comment[ca]=Genera una plantilla per a un mòdul del nucli Linux. +Comment[da]=Genererer en skabelon for en Linux kernemodul. +Comment[de]=Erstellt eine Vorlage für ein Linux-Kernelmodul. +Comment[el]=Δημιουργεί ένα πρότυπο για ένα άρθρωμα του πυρήνα του Linux. +Comment[es]=Genera una plantilla para un módulo del núcleo de Linux. +Comment[et]=Linuxi kerneli mooduli malli loomine. +Comment[eu]=Linux kernel modulu batentzat txantiloi bat sortzen du. +Comment[fa]=قالبی برای پیمانۀ هستۀ لینوکس تولید میکند +Comment[fr]=Génère un modèle pour un module de noyau Linux. +Comment[gl]=Xera unha modelo dun módulo para o kernel Linux. +Comment[hu]=Létrehoz egy sablont linuxos kernelmodul készítéséhez. +Comment[it]=Genera un modello per un modulo del kernel Linux kernel. +Comment[ja]=Linux カーネルモジュール用のテンプレートを作成します +Comment[nds]=Stellt en Vörlaag för en Linux-Kernelmoduul op. +Comment[ne]=लिनक्स कर्नेल मोड्युलका लागि टेम्प्लेट उत्पन्न गर्दछ +Comment[nl]=Genereert een sjabloon voor een Linux kernelmodule +Comment[pl]=Generuje szablon dla modułu jądra Linuksa. +Comment[pt]=Gera um modelo para um módulo do 'kernel' do Linux. +Comment[pt_BR]=Gera um modelo para um módulo do 'kernel' do Linux. +Comment[ru]=Создание драйвера ядра Linux. +Comment[sk]=Vygeneruje šablónu pre Linux kernel modul +Comment[sr]=Прави шаблон за модул језгра Linux-а. +Comment[sr@Latn]=Pravi šablon za modul jezgra Linux-a. +Comment[sv]=Skapar en mall för en modul i Linux kärna. +Comment[tr]=Bir Linux çekirdek birimi için bir şablon yaratır. +Comment[zh_CN]=生成一个 Linux 内核模块的模板。 +Comment[zh_TW]=產生一個 Linux 核心模組的樣本 +FileTemplates=h,CStyle,c,CStyle +ShowFilesAfterGeneration=%{dest}/%{APPNAMELC}-driver.c +Archive=kmod.tar.gz + +[GNU] +Type=include +File=%{kdevelop}/template-common/gnu.kdevtemplate + +[FILE1] +Type=install +EscapeXML=true +Source=%{src}/kmod.kdevelop +Dest=%{dest}/%{APPNAMELC}.kdevelop + +[FILE2] +Type=install +Source=%{src}/src-Makefile +Dest=%{dest}/Makefile + +[FILE3] +Type=install +Source=%{src}/kmod-driver.c +Dest=%{dest}/%{APPNAMELC}-driver.c + +[MSG] +Type=message +Command=A linux kernel module was created in %{dest} diff --git a/languages/cpp/app_templates/kmod/kmod.png b/languages/cpp/app_templates/kmod/kmod.png Binary files differnew file mode 100644 index 00000000..840a953c --- /dev/null +++ b/languages/cpp/app_templates/kmod/kmod.png diff --git a/languages/cpp/app_templates/kmod/src-Makefile b/languages/cpp/app_templates/kmod/src-Makefile new file mode 100644 index 00000000..92a2b461 --- /dev/null +++ b/languages/cpp/app_templates/kmod/src-Makefile @@ -0,0 +1,30 @@ +TARGET = %{APPNAMELC}-driver +OBJS = %{APPNAMELC}-driver.o +MDIR = drivers/misc + +EXTRA_CFLAGS = -DEXPORT_SYMTAB +CURRENT = $(shell uname -r) +KDIR = /lib/modules/$(CURRENT)/build +PWD = $(shell pwd) +DEST = /lib/modules/$(CURRENT)/kernel/$(MDIR) + +obj-m := $(TARGET).o + +default: + make -C $(KDIR) SUBDIRS=$(PWD) modules + +$(TARGET).o: $(OBJS) + $(LD) $(LD_RFLAG) -r -o $@ $(OBJS) + +ifneq (,$(findstring 2.4.,$(CURRENT))) +install: + su -c "cp -v $(TARGET).o $(DEST) && /sbin/depmod -a" +else +install: + su -c "cp -v $(TARGET).ko $(DEST) && /sbin/depmod -a" +endif + +clean: + -rm -f *.o *.ko .*.cmd .*.flags *.mod.c + +-include $(KDIR)/Rules.make |