Distributions
Ubuntu
Fedora
CentOS
中文资源站
网易开源镜像站
ericyue
V2EX  ›  Linux

如何共享一个makefile?

  •  
  •   ericyue ·
    ericyue · Jan 2, 2013 · 4235 views
    This topic created in 4899 days ago, the information mentioned may be changed or developed.
    比如两个目录都需要makefile文件,我想让两个目录的makefile都指向同一个文件.貌似ln -s不行.
    7 replies    1970-01-01 08:00:00 +08:00
    join
        1
    join  
       Jan 2, 2013 via Android
    2种方法:
    1:一个makefile include 2个makefile
    2:重写一个makefile make 两个文件夹
    ericyue
        2
    ericyue  
    OP
       Jan 2, 2013
    @join 可能没理解我的意思 我的makefile是类似模板的,对每个工程都通用. 我想实现更改一各地方的makefile就能同步到所有的工程
    LazyZhu
        3
    LazyZhu  
       Jan 2, 2013
    用 `ln` 硬链接
    fox000002
        4
    fox000002  
       Jan 2, 2013
    如果完全相同的话,make -C /your/path 也是一种途径
    ericyue
        5
    ericyue  
    OP
       Jan 3, 2013
    @LazyZhu 用硬连接后 如果我想删除这个文件,要去每个地方删除一边吧?
    ericyue
        6
    ericyue  
    OP
       Jan 3, 2013
    @fox000002 恩 这倒是可以 不过makefile里面的路劲就乱了 不过可以改改 感谢
    tangzx
        7
    tangzx  
       Jan 3, 2013 via iPad
    Make -f ../another/Makefile
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1770 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 97ms · UTC 16:26 · PVG 00:26 · LAX 09:26 · JFK 12:26
    ♥ Do have faith in what you're doing.