Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

217
Visualizações
obj-m variable in a kernel module

In the kernel module makefile obj-m variable exists. Consider the following:

CUR = $(shell uname -r) 
DIR = /lib/modules/$(CUR)/build 
PWD = $(shell pwd) 
obj-m   := m1.o m2.o 
default: 
        $(MAKE) -C $(DIR) SUBDIRS=$(PWD) modules 

In this Makefile, the default target contains a recipe which invokes kernel sub-make. The obj-m variable doesn't get exported to environment thus sub-make cannot use it. But if we delete the obj-m variable initialization, then this make doesn't compile m1 and m2 kernel modules. So, question is:

Why kernel sub-make depends on the non-exported obj-m variable in this case?

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

None of the make variables are exported to the environment.

SUBDIRS gets defined as a make variable. The kernel makefile looks for the Makefile in SUBDIRS, reads it, and uses any obj-* defined therein.

(According to the documentation, you should use M instead of SUBDIRS.)

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda