Build libraries reliably with multiple jobs
This commit is contained in:
parent
969eef859c
commit
08a54f65c4
@ -1222,18 +1222,14 @@ static int _target_library(Configure * configure, FILE * fp,
|
|||||||
if(soname == NULL)
|
if(soname == NULL)
|
||||||
return 1;
|
return 1;
|
||||||
if(configure->os == HO_MACOSX)
|
if(configure->os == HO_MACOSX)
|
||||||
_makefile_print(fp, "%s%s%s%s%s%s%s%s%s%s%s%s",
|
_makefile_print(fp, "%s%s%s%s%s", "\n$(OBJDIR)", soname, ": $(",
|
||||||
"\n$(OBJDIR)", soname, " $(OBJDIR)", target,
|
target, "_OBJS)");
|
||||||
".0", soext, " $(OBJDIR)", target, soext,
|
|
||||||
": $(", target, "_OBJS)");
|
|
||||||
else if(configure->os == HO_WIN32)
|
else if(configure->os == HO_WIN32)
|
||||||
_makefile_print(fp, "%s%s%s%s%s", "\n$(OBJDIR)", soname,
|
_makefile_print(fp, "%s%s%s%s%s", "\n$(OBJDIR)", soname, ": $(",
|
||||||
": $(", target, "_OBJS)");
|
target, "_OBJS)");
|
||||||
else
|
else
|
||||||
_makefile_print(fp, "%s%s%s%s%s%s%s%s%s%s",
|
_makefile_print(fp, "%s%s%s%s%s", "\n$(OBJDIR)", soname,
|
||||||
"\n$(OBJDIR)", soname, ".0 $(OBJDIR)", soname,
|
".0: $(", target, "_OBJS)");
|
||||||
" $(OBJDIR)", target, soext, ": $(", target,
|
|
||||||
"_OBJS)");
|
|
||||||
if((p = config_get(configure->config, target, "depends")) != NULL)
|
if((p = config_get(configure->config, target, "depends")) != NULL)
|
||||||
_makefile_print(fp, " %s", p);
|
_makefile_print(fp, " %s", p);
|
||||||
/* build the shared library */
|
/* build the shared library */
|
||||||
@ -1264,15 +1260,22 @@ static int _target_library(Configure * configure, FILE * fp,
|
|||||||
_makefile_print(fp, "%c", '\n');
|
_makefile_print(fp, "%c", '\n');
|
||||||
if(configure->os == HO_MACOSX)
|
if(configure->os == HO_MACOSX)
|
||||||
{
|
{
|
||||||
|
_makefile_print(fp, "%s%s%s%s%s", "\n$(OBJDIR)", target, ".0",
|
||||||
|
soext, ":\n");
|
||||||
_makefile_print(fp, "%s%s%s%s%s%s%s", "\t$(LN) -s -- ", soname,
|
_makefile_print(fp, "%s%s%s%s%s%s%s", "\t$(LN) -s -- ", soname,
|
||||||
" $(OBJDIR)", target, ".0", soext, "\n");
|
" $(OBJDIR)", target, ".0", soext, "\n");
|
||||||
|
_makefile_print(fp, "%s%s%s%s", "\n$(OBJDIR)", target, soext,
|
||||||
|
":\n");
|
||||||
_makefile_print(fp, "%s%s%s%s%s%s", "\t$(LN) -s -- ", soname,
|
_makefile_print(fp, "%s%s%s%s%s%s", "\t$(LN) -s -- ", soname,
|
||||||
" $(OBJDIR)", target, soext, "\n");
|
" $(OBJDIR)", target, soext, "\n");
|
||||||
}
|
}
|
||||||
else if(configure->os != HO_WIN32)
|
else if(configure->os != HO_WIN32)
|
||||||
{
|
{
|
||||||
|
_makefile_print(fp, "%s%s%s", "\n$(OBJDIR)", soname, ":\n");
|
||||||
_makefile_print(fp, "%s%s%s%s%s", "\t$(LN) -s -- ", soname,
|
_makefile_print(fp, "%s%s%s%s%s", "\t$(LN) -s -- ", soname,
|
||||||
".0 $(OBJDIR)", soname, "\n");
|
".0 $(OBJDIR)", soname, "\n");
|
||||||
|
_makefile_print(fp, "%s%s%s%s", "\n$(OBJDIR)", target, soext,
|
||||||
|
":\n");
|
||||||
_makefile_print(fp, "%s%s%s%s%s%s", "\t$(LN) -s -- ", soname,
|
_makefile_print(fp, "%s%s%s%s%s%s", "\t$(LN) -s -- ", soname,
|
||||||
".0 $(OBJDIR)", target, soext, "\n");
|
".0 $(OBJDIR)", target, soext, "\n");
|
||||||
}
|
}
|
||||||
|
@ -23,9 +23,13 @@ $(OBJDIR)libtest.a: $(libtest_OBJS)
|
|||||||
$(AR) -rc $(OBJDIR)libtest.a $(libtest_OBJS)
|
$(AR) -rc $(OBJDIR)libtest.a $(libtest_OBJS)
|
||||||
$(RANLIB) $(OBJDIR)libtest.a
|
$(RANLIB) $(OBJDIR)libtest.a
|
||||||
|
|
||||||
$(OBJDIR)libtest.0.0.dylib $(OBJDIR)libtest.0.dylib $(OBJDIR)libtest.dylib: $(libtest_OBJS)
|
$(OBJDIR)libtest.0.0.dylib: $(libtest_OBJS)
|
||||||
$(CCSHARED) -o $(OBJDIR)libtest.0.0.dylib -install_name $(LIBDIR)/libtest.0.dylib $(libtest_OBJS) $(libtest_LDFLAGS)
|
$(CCSHARED) -o $(OBJDIR)libtest.0.0.dylib -install_name $(LIBDIR)/libtest.0.dylib $(libtest_OBJS) $(libtest_LDFLAGS)
|
||||||
|
|
||||||
|
$(OBJDIR)libtest.0.dylib:
|
||||||
$(LN) -s -- libtest.0.0.dylib $(OBJDIR)libtest.0.dylib
|
$(LN) -s -- libtest.0.0.dylib $(OBJDIR)libtest.0.dylib
|
||||||
|
|
||||||
|
$(OBJDIR)libtest.dylib:
|
||||||
$(LN) -s -- libtest.0.0.dylib $(OBJDIR)libtest.dylib
|
$(LN) -s -- libtest.0.0.dylib $(OBJDIR)libtest.dylib
|
||||||
|
|
||||||
$(OBJDIR)test.o: test.c
|
$(OBJDIR)test.o: test.c
|
||||||
|
@ -23,9 +23,13 @@ $(OBJDIR)libtest.a: $(libtest_OBJS)
|
|||||||
$(AR) -rc $(OBJDIR)libtest.a $(libtest_OBJS)
|
$(AR) -rc $(OBJDIR)libtest.a $(libtest_OBJS)
|
||||||
$(RANLIB) $(OBJDIR)libtest.a
|
$(RANLIB) $(OBJDIR)libtest.a
|
||||||
|
|
||||||
$(OBJDIR)libtest.so.0.0 $(OBJDIR)libtest.so.0 $(OBJDIR)libtest.so: $(libtest_OBJS)
|
$(OBJDIR)libtest.so.0.0: $(libtest_OBJS)
|
||||||
$(CCSHARED) -o $(OBJDIR)libtest.so.0.0 -Wl,-soname,libtest.so.0 $(libtest_OBJS) $(libtest_LDFLAGS)
|
$(CCSHARED) -o $(OBJDIR)libtest.so.0.0 -Wl,-soname,libtest.so.0 $(libtest_OBJS) $(libtest_LDFLAGS)
|
||||||
|
|
||||||
|
$(OBJDIR)libtest.so.0:
|
||||||
$(LN) -s -- libtest.so.0.0 $(OBJDIR)libtest.so.0
|
$(LN) -s -- libtest.so.0.0 $(OBJDIR)libtest.so.0
|
||||||
|
|
||||||
|
$(OBJDIR)libtest.so:
|
||||||
$(LN) -s -- libtest.so.0.0 $(OBJDIR)libtest.so
|
$(LN) -s -- libtest.so.0.0 $(OBJDIR)libtest.so
|
||||||
|
|
||||||
$(OBJDIR)test.o: test.c
|
$(OBJDIR)test.o: test.c
|
||||||
|
@ -23,9 +23,13 @@ $(OBJDIR)libtest.a: $(libtest_OBJS)
|
|||||||
$(AR) -rc $(OBJDIR)libtest.a $(libtest_OBJS)
|
$(AR) -rc $(OBJDIR)libtest.a $(libtest_OBJS)
|
||||||
$(RANLIB) $(OBJDIR)libtest.a
|
$(RANLIB) $(OBJDIR)libtest.a
|
||||||
|
|
||||||
$(OBJDIR)libtest.so.0.0 $(OBJDIR)libtest.so.0 $(OBJDIR)libtest.so: $(libtest_OBJS)
|
$(OBJDIR)libtest.so.0.0: $(libtest_OBJS)
|
||||||
$(CCSHARED) -o $(OBJDIR)libtest.so.0.0 -Wl,-soname,libtest.so.0 $(libtest_OBJS) $(libtest_LDFLAGS)
|
$(CCSHARED) -o $(OBJDIR)libtest.so.0.0 -Wl,-soname,libtest.so.0 $(libtest_OBJS) $(libtest_LDFLAGS)
|
||||||
|
|
||||||
|
$(OBJDIR)libtest.so.0:
|
||||||
$(LN) -s -- libtest.so.0.0 $(OBJDIR)libtest.so.0
|
$(LN) -s -- libtest.so.0.0 $(OBJDIR)libtest.so.0
|
||||||
|
|
||||||
|
$(OBJDIR)libtest.so:
|
||||||
$(LN) -s -- libtest.so.0.0 $(OBJDIR)libtest.so
|
$(LN) -s -- libtest.so.0.0 $(OBJDIR)libtest.so
|
||||||
|
|
||||||
$(OBJDIR)test.o: test.c
|
$(OBJDIR)test.o: test.c
|
||||||
|
Loading…
Reference in New Issue
Block a user