Update Makefile, Adding more fileext to .gitignorey
This commit is contained in:
parent
48717aa477
commit
85eb771fa5
12
.gitignore
vendored
12
.gitignore
vendored
@ -1,7 +1,15 @@
|
|||||||
|
|
||||||
*.anjuta*
|
*.anjuta*
|
||||||
|
|
||||||
|
*.mod.*
|
||||||
|
8008135
|
||||||
*.out
|
*.out
|
||||||
*.a
|
*.a
|
||||||
*.ko
|
*.ko
|
||||||
*.o
|
*.o
|
||||||
*.*~
|
|
||||||
8008135
|
*~
|
||||||
|
*.symvers
|
||||||
|
*.order
|
||||||
|
.tmp_versions/
|
||||||
|
*.cmd
|
||||||
|
47
8008135.c
47
8008135.c
@ -17,10 +17,47 @@
|
|||||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <stdio.h>
|
/**** Includes ***************************************************************
|
||||||
int main()
|
*******************************************************************************/
|
||||||
{
|
#include <linux/init.h>
|
||||||
printf("Hello world\n");
|
#include <linux/module.h>
|
||||||
return (0);
|
#include <linux/kernel.h>
|
||||||
|
|
||||||
|
|
||||||
|
/**** Modinfo ****************************************************************
|
||||||
|
*******************************************************************************/
|
||||||
|
|
||||||
|
MODULE_LICENSE("GPLv3");
|
||||||
|
MODULE_AUTHOR("JanKoernerEnterprises");
|
||||||
|
MODULE_DESCRIPTION("8008135");
|
||||||
|
MODULE_VERSION("0.1");
|
||||||
|
|
||||||
|
/**** var ********************************************************************
|
||||||
|
*******************************************************************************/
|
||||||
|
static char *name = "8008135";
|
||||||
|
|
||||||
|
|
||||||
|
/*** FUNCTION ****************************************************************
|
||||||
|
* NAME: init_8008135
|
||||||
|
* DESCRIPTION: initializing Kernel Module
|
||||||
|
* PARAMETERS: -
|
||||||
|
* RETURNS: int
|
||||||
|
*******************************************************************************/
|
||||||
|
static int __init init_8008135(void) {
|
||||||
|
printk(KERN_INFO "Loading %s into Kernel", name);
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*** FUNCTION ****************************************************************
|
||||||
|
* NAME: exit_8008135
|
||||||
|
* DESCRIPTION: unloading Kernel Module
|
||||||
|
* PARAMETERS: -
|
||||||
|
* RETURNS: -
|
||||||
|
*******************************************************************************/
|
||||||
|
static void __exit exit_8008135(void) {
|
||||||
|
printk(KERN_INFO "Unloading %s from Kernel", name);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Setting pointers to init-/exit-functions
|
||||||
|
module_init(init_8008135);
|
||||||
|
module_exit(exit_8008135);
|
||||||
|
31
Makefile
31
Makefile
@ -1,30 +1,9 @@
|
|||||||
|
obj-m+=8008135.o
|
||||||
|
|
||||||
## Created by Anjuta
|
all:
|
||||||
|
make -C /lib/modules/$(shell uname -r)/build/ M=$(PWD) modules
|
||||||
CC = gcc
|
|
||||||
CFLAGS = -g -Wall
|
|
||||||
OBJECTS = 8008135.o
|
|
||||||
INCFLAGS =
|
|
||||||
LDFLAGS = -Wl,-rpath,/usr/local/lib
|
|
||||||
LIBS =
|
|
||||||
|
|
||||||
all: 8008135
|
|
||||||
|
|
||||||
8008135: $(OBJECTS)
|
|
||||||
$(CC) -o 8008135 $(OBJECTS) $(LDFLAGS) $(LIBS)
|
|
||||||
|
|
||||||
.SUFFIXES:
|
|
||||||
.SUFFIXES: .c .cc .C .cpp .o
|
|
||||||
|
|
||||||
.c.o :
|
|
||||||
$(CC) -o $@ -c $(CFLAGS) $< $(INCFLAGS)
|
|
||||||
|
|
||||||
count:
|
|
||||||
wc *.c *.cc *.C *.cpp *.h *.hpp
|
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f *.o
|
make -C /lib/modules/$(shell uname -r)/build/ M=$(PWD) clean
|
||||||
|
|
||||||
|
|
||||||
.PHONY: all
|
|
||||||
.PHONY: count
|
|
||||||
.PHONY: clean
|
|
||||||
|
Loading…
Reference in New Issue
Block a user