Makefile rule to create DEPDIR Topic is solved

Use this forum for requesting small changes in ChibiOS. Large changes should be discussed in the development forum. This forum is NOT for support.
faisal
Posts: 374
Joined: Wed Jul 19, 2017 12:44 am
Has thanked: 44 times
Been thanked: 60 times

Makefile rule to create DEPDIR  Topic is solved

Postby faisal » Sat Mar 17, 2018 4:40 am

This seems to be a missing feature in rules.mk . All the more important with multi-demos.

Code: Select all

$(OBJS): | $(BUILDDIR) $(OBJDIR) $(LSTDIR) $(DEPDIR)

$(BUILDDIR):
ifneq ($(USE_VERBOSE_COMPILE),yes)
   @echo Compiler Options
   @echo $(CC) -c $(CFLAGS) -I. $(IINCDIR) main.c -o main.o
   @echo
endif
   @mkdir -p $(BUILDDIR)

$(OBJDIR):
   @mkdir -p $(OBJDIR)

$(LSTDIR):
   @mkdir -p $(LSTDIR)
   
[b]$(DEPDIR):
   @mkdir -p $(DEPDIR)[/b]

User avatar
Giovanni
Site Admin
Posts: 14444
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1074 times
Been thanked: 921 times
Contact:

Re: Makefile rule to create DEPDIR

Postby Giovanni » Sat Mar 17, 2018 9:13 am

Hi,

Isn't this done at the end of the rules.mk file?

Code: Select all

#
# Include the dependency files, should be the last of the makefile
#
-include $(shell mkdir -p $(DEPDIR) 2>/dev/null)


Is there a case where this does not work?

Giovanni

faisal
Posts: 374
Joined: Wed Jul 19, 2017 12:44 am
Has thanked: 44 times
Been thanked: 60 times

Re: Makefile rule to create DEPDIR

Postby faisal » Sun Mar 18, 2018 2:07 am

I have a project which needs to support multiple boards. So I tried following the pattern of the 'multi' projects in testhal. I wanted to create a single .dep directory for dependencies, and then sub directories in there for the various boards. So, in the makefile for each board, I have the following variables defined:

CONFDIR := ./cfg/$(BOARD_NAME)
BUILDDIR := ./build/$(BOARD_NAME)
DEPDIR := ./.dep/$(BOARD_NAME)

I got the following error if I didn't modify rules.mk as above.

Compiling crt0_v7m.S
../../../../ChibiOS_18.2.0/os/common/startup/ARMCMx/compilers/GCC/crt0_v7m.S:1:0: fatal error: opening dependency file ./.dep/stm32l496-snapdragon/crt0_v7m.o.d: No such file or directory

I got not such error with CONFDIR, or BUILDDIR.

User avatar
Giovanni
Site Admin
Posts: 14444
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1074 times
Been thanked: 921 times
Contact:

Re: Makefile rule to create DEPDIR

Postby Giovanni » Fri Mar 23, 2018 12:00 pm

Hi,

I applied the change among other things, please check it is OK for you.

Giovanni

faisal
Posts: 374
Joined: Wed Jul 19, 2017 12:44 am
Has thanked: 44 times
Been thanked: 60 times

Re: Makefile rule to create DEPDIR

Postby faisal » Tue Mar 27, 2018 9:30 pm

I don't see the change in 18.2.x stable. The changes you made in trunk look like what I need. Thanks for that! Any plans to update 18.2 stable?

faisal
Posts: 374
Joined: Wed Jul 19, 2017 12:44 am
Has thanked: 44 times
Been thanked: 60 times

Re: Makefile rule to create DEPDIR

Postby faisal » Thu Apr 05, 2018 5:34 am

Saw it backported to 18.2 stable. Thanks Giovanni.


Return to “Small Change Requests”

Who is online

Users browsing this forum: Google [Bot] and 1 guest