Hello all,
I am not getting how to write a Makefile and require your help. I have written 2 modules in which exporting_module.c exports function and using_module.c uses that module.
when i give following command without creating makefile i got errors
[myhost@localhost module]# gcc -c using_module.c exporting_module.c -I /usr/src/linux-2.4.22-1.2115.nptl/include/
using_module.c: In function `func1':
using_module.c:30: warning: assignment makes pointer from integer without a cast
exporting_module.c:106: error: syntax error before "this_object_must_be_defined_as_export_objs_in_the_Makefile"
exporting_module.c:106: warning: data definition has no type or storage class
I have defined MODULE and __KERNEL__ symbols in both modules.
I also then tried with makefile but it is not working
*************Makefile*************
KERNELDIR = /usr/src/linux-2.4.22-1.2115.nptl
CFLAGS = -I$(KERNELDIR)/include -Wall
all: all.o
export-objs =: exporting_module.o
all.o: using_module.o exporting_module.o exporting_module.h
$(LD) -r $^ -o $@
clean:
rm -f *.o *~ core
Sombody please correct me where am i going wrong?
regards,
parag.