@@ -430,7 +430,7 @@ xbool_t SMake_WriteMake(smake_ctx_t *pCtx)
430430
431431 xbool_t bLDLibs = xstrused (sLd );
432432 if (xstrused (sLd )) XFile_Print (& file , "LD_LIBS = %s\n" , sLd );
433- XFile_Print (& file , "LDFLAGS =%s%s\n" , xstrused ( pCtx -> sLDFlags ) ? " " : " " , pCtx -> sLDFlags );
433+ if ( xstrused ( pCtx -> sLDFlags )) XFile_Print (& file , "LDFLAGS = %s\n " , pCtx -> sLDFlags );
434434
435435 XFile_Print (& file , "LIBS = %s\n" , sLibs );
436436 XFile_Print (& file , "NAME = %s\n" , pCtx -> sName );
@@ -496,10 +496,19 @@ xbool_t SMake_WriteMake(smake_ctx_t *pCtx)
496496 XFile_Print (& file , "\t$(%s) $(%s)%s -c -o $(ODIR)/$@ $< $(LIBS)\n\n" , pCompiler , pCFlags , pFPICOption );
497497 XFile_Print (& file , "$(NAME):$(OBJS)\n" );
498498
499+
499500 if (bStatic ) XFile_Print (& file , "\t$(AR) rcs $(ODIR)/$(NAME) $(OBJECTS)\n" );
500501 else if (bShared ) XFile_Print (& file , "\t$(%s) -shared -o $(ODIR)/$(NAME) $(OBJECTS)\n" , pCompiler );
501- else if (!bLDLibs ) XFile_Print (& file , "\t$(%s) $(%s) $(LDFLAGS) -o $(ODIR)/$(NAME) $(OBJECTS) $(LIBS)\n" , pCompiler , pCFlags );
502- else XFile_Print (& file , "\t$(%s) $(%s) $(LDFLAGS) -o $(ODIR)/$(NAME) $(OBJECTS) $(LD_LIBS) $(LIBS)\n" , pCompiler , pCFlags );
502+ else if (xstrused (pCtx -> sLDFlags ))
503+ {
504+ if (!bLDLibs ) XFile_Print (& file , "\t$(%s) $(%s) $(LDFLAGS) -o $(ODIR)/$(NAME) $(OBJECTS) $(LIBS)\n" , pCompiler , pCFlags );
505+ else XFile_Print (& file , "\t$(%s) $(%s) $(LDFLAGS) -o $(ODIR)/$(NAME) $(OBJECTS) $(LD_LIBS) $(LIBS)\n" , pCompiler , pCFlags );
506+ }
507+ else
508+ {
509+ if (!bLDLibs ) XFile_Print (& file , "\t$(%s) $(%s) -o $(ODIR)/$(NAME) $(OBJECTS) $(LIBS)\n" , pCompiler , pCFlags );
510+ else XFile_Print (& file , "\t$(%s) $(%s) -o $(ODIR)/$(NAME) $(OBJECTS) $(LD_LIBS) $(LIBS)\n" , pCompiler , pCFlags );
511+ }
503512
504513 if (bInstallBinary || bInstallIncludes )
505514 {
0 commit comments