Make multiple targets in 'all'
        Posted  
        
            by 
                Hiett
            
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by Hiett
        
        
        
        Published on 2012-06-07T09:17:34Z
        Indexed on 
            2012/06/07
            16:40 UTC
        
        
        Read the original article
        Hit count: 258
        
i'm trying to build a debug and release version of a library with a Makefile and copy those libraries to the relevant build directories, e.g.
.PHONY: all clean distclean
all: $(program_NAME_DEBUG)
    $(CP) $(program_NAME_DEBUG) $(BUILD_DIR)/debug/$(program_NAME_DEBUG)
    $(RM) $(program_NAME_DEBUG)
    $(RM) $(program_OBJS)
    $(program_NAME_RELEASE)
    $(CP) $(program_NAME_RELEASE) $(BUILD_DIR)/release/$(program_NAME_RELEASE)
    $(RM) $(program_NAME_RELEASE)
    $(RM) $(program_OBJS)
$(program_NAME_DEBUG): $(program_OBJS)
    $(LINK_DEBUG.c) -shared -Wl,-soname,$(program_NAME_DEBUG) $(program_OBJS) -o $(program_NAME_DEBUG)
$(program_NAME_RELEASE): $(program_OBJS)
    $(LINK_RELEASE.c) -shared -Wl,-soname,$(program_NAME_RELEASE) $(program_OBJS) -o $(program_NAME_RELEASE)
The 1st target in all (program_NAME_DEBUG) compiles OK but the 2nd, (program_NAME_RELEASE) produces the following error:
libGlamdring_rel.so
make: libGlamdring_rel.so: Command not found
make: *** [all] Error 127
libGlamdring_rel.so is the value of program_NAME_RELEASE
It doesn't seem to be recognising the 2nd target as it does the 1st?
© Stack Overflow or respective owner