I have this makefile. when running make
commmand I get this error
make -C /lib/modules/5.13.0-21-generic/build M=/home/fawad/Desktop/ext2/linux-5.14.21/fs/ext2 modules
make[1]: Entering directory '/usr/src/linux-headers-5.13.0-21-generic'
LD [M] /home/fawad/Desktop/ext2/linux-5.14.21/fs/ext2/hijj.o
ld: no input files
make[2]: *** [scripts/Makefile.build:458: /home/fawad/Desktop/ext2/linux-5.14.21/fs/ext2/hijj.o] Error 1
make[1]: *** [Makefile:1874: /home/fawad/Desktop/ext2/linux-5.14.21/fs/ext2] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-5.13.0-21-generic'
make: *** [Makefile:33: all] Error 2
I like to know why I am getting error that ld: no input files
since I have provided input files as super.c acl.c balloc.c dir.c file.c ialloc.c inode.c ioctl.c namei.c symlink.c xattr.c xattr_security.c xattr_trusted.c xattr_user.c
this is my makefile
#Comment/uncomment the following line to disable/enable debugging
#DEBUG = y
CFLAGS_hijj.ko := -DDEBUG
# Add your debugging flag (or not) to CFLAGS
ifeq ($(DEBUG),y)
DEBFLAGS = -O -g -DSHORT_DEBUG # "-O" is needed to expand inlines
else
DEBFLAGS = -O2
endif
CFLAGS += $(DEBFLAGS)
CFLAGS += -I..
ifneq ($(KERNELRELEASE),)
# call from kernel build system
obj-m += hijj.o
hijj-y := super.c acl.c balloc.c dir.c file.c ialloc.c inode.c ioctl.c namei.c symlink.c xattr.c xattr_security.c xattr_trusted.c xattr_user.c
clean :
rm -rf *.o *~ core .depend .*.cmd *.ko *.mod.c .tmp_versions
else
KERNELDIR ?= /lib/modules/$(shell uname -r)/build
PWD := $(shell pwd)
all:
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules
endif
depend .depend dep:
$(CC) $(CFLAGS) -M *.c > .depend
ifeq (.depend,$(wildcard .depend))
include .depend
endif
The above makefile Is I made for ext2 file system then need to install with insmod
as out of tree as kernel module
Update
I think the error is in this line of /lib/modules/5.13.0-21-generic/build directory makefile. This is error make[1]: *** [Makefile:1874: /home/fawad/Desktop/ext2/linux-5.14.21/fs/ext2] Error 2
in the my output of make command
$(build-dirs): prepare
$(Q)$(MAKE) $(build)=$@ \
single-build=$(if $(filter-out $@/, $(filter $@/%, $(KBUILD_SINGLE_TARGETS))),1) \
need-builtin=1 need-modorder=1
Update 2
My make stops at this. result from make --print-data-base -p
# recipe to execute (from 'Makefile', line 32):
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules
# Not a target:
.w.tex:
# Builtin rule
# Implicit rule search has not been done.
# Modification time never checked.
# File has not been updated.
# recipe to execute (built-in):
$(CWEAVE) $< - $@