Workaround for GNU Make 3.80 eval bug

后端 未结 2 1870
野趣味
野趣味 2021-01-19 06:23

I\'m trying to create a generic build template for my Makefiles, kind of like they discuss in the eval documentation.

I\'ve run into a known bug with GNU Make 3.80.

2条回答
  •  温柔的废话
    2021-01-19 07:15

    lol hacks

    ifneq (3.81,$(shell (echo $(MAKE_VERSION); echo 3.81) | sort | head -n1))
    
    make-3.81/make:
            wget -nc http://ftp.gnu.org/pub/gnu/make/make-3.81.tar.gz
            gzip -cd make-3.81.tar.gz | tar xvf -
            cd make-3.81 && ./configure --prefix=$$(pwd)
            $(MAKE) -C make-3.81 make
    
    %: make-3.81/make
            make-3.81/make $@
    
    else
    
    # rest of your makefile
    
    endif
    

    Seriously though, there can't possibly be anything preventing you from installing 3.81, even if it is only locally.

提交回复
热议问题