tar: file changed as we read it

I also encounter the tar messages “changed as we read it”. For me these message occurred when I was making tar file of Linux file system in bitbake build environment. This error was sporadic. For me this was not due to creating tar file from the same directory. I am assuming there is actually some … Read more

Generic rule from makefile to CMake

In CMake you can always declare your own compiler language. So in your case you can e.g. do: cmake_minimum_required(VERSION 2.8) project(MakeBarFromFoo NONE) set( CMAKE_FOO_COMPILE_OBJECT “make_bar_from_foo <SOURCE> <OBJECT>” ) file(GLOB SRCS “*.foo”) add_library(my_rule OBJECT ${SRCS}) set_source_files_properties(${SRCS} PROPERTIES LANGUAGE FOO) Then you can simply work with it as you would with other object library targets. But you … Read more

Why are .PHONY implicit pattern rules not triggered?

You’re right, it would make more sense to define the subdir rules as PHONY. But Make does not consider implicit rules for PHONY targets, so you’ll have to rewrite that rule. I suggest the following: SUBDIR_TARGETS = all.subdir clean.subdir .PHONY: all clean $(SUBDIR_TARGETS) $(SUBDIR_TARGETS): %.subdir: $(MAKE) -C src $* $(MAKE) -C dict $* all: all.subdir … Read more

Makefile header dependencies

Suppose foo.c has a line: #include “something.h” You’d like a line in the makefile: foo.o: foo.c something.h The gcc compiler can construct that line for you. The command gcc -MMD -c -o foo.o foo.c will build foo.o and foo.d which contains the line. (Try it.) So just modify your makefile to produce these *.d files … Read more