Makefile updated library dependency

前端 未结 3 1484
太阳男子
太阳男子 2021-01-22 05:03

I have a large makefile which builds several libraries, installs them, and then keeps on building objects which link against those installed libraries. My trouble is that I wan

3条回答
  •  一整个雨季
    2021-01-22 05:28

    How about this:

    LIBS = foo bar blah # and so on
    
    LINKFLAGS = $(addprefix -l,$(LIBS))
    
    LIBPATHS = $(patsubst %,/explicit/path/to/lib/lib%.so, $(LIBS))
    
    $(myObject): $(localSrc) $(LIBPATHS)
            $(CXX) $(CPPFLAGS) $(INCFLAGS) -o $@ $^ $(LINKFLAGS) $(LINKLIBS)
    

提交回复
热议问题