Dear Tim, don’t you think the same about boost libraries? BTW I don’t agree with the attitude about proper design… every component(library) is growing and sometimes architecture undergo changes
As the result we have a directory with all avaliable libraries of any verions
Once again “source” is not generated it is under source control, just without TARGETNAME
we gen “makefile” using the following script…
—8<--------------------------------------------------------------------------------------------------->8—
@setlocal ENABLEDELAYEDEXPANSION
@echo off
if “%1” == “” (
echo ERROR: Parameter wasn’t specified. Set include file path.
goto :eof
)
:
: Check if *.h exist
:
if not exist “%1” (
echo ERROR: %1 couldn’t be found.
goto :eof
)
if not exist sources (
echo ERROR: “Sources” file doesn’t exist.
goto :eof
)
findstr “TARGETNAME” sources>nul
if !errorlevel! == 0 (
echo ERROR: Found TARGETNAME in “Sources”, but name required to be generated automatically
goto :eof
)
:
: Get the project version
:
for /f "tokens=2 delims=COMPONENT_VER_MJ " %%i in (‘"findstr “COMPONENT_VER_MJ " %1”’) do set COMPONENT_VER_MJ=%%i&goto mj_found
:mj_found
for /f "tokens=2 delims=COMPONENT_VER_MN " %%i in (‘"findstr “COMPONENT_VER_MN " %1”’) do set COMPONENT_VER_MN=%%i&goto mn_found
:mn_found
for /f "tokens=2* delims=COMPONENT_NAME " %%i in (‘"findstr “COMPONENT_NAME " %1”’) do set COMPONENT_NAME=%%i&goto name_found
:name_found
set COMPONENT_NAME=!COMPONENT_NAME:"=!
if not “!COMPONENT_VER_MJ!”==“” (
if not “!COMPONENT_VER_MN!”==“” (
goto ver_ok
)
)
echo ERROR: COMPONENT_VER_MJ and COMPONENT_VER_MN MUST be declared in %1
echo INFO: Header file should contain following definitions to be correct.
echo INFO: —8<---- *.h ---->8—
echo INFO: #define COMPONENT_NAME “lower_case_name”
echo INFO: #define COMPONENT_VER_MJ V
echo INFO: #define COMPONENT_VER_MN V
echo INFO: —8<---- *.h ---->8—
goto :eof
:ver_ok
if exist makefile (
echo INFO: “makefile” will be overwritten…
)
echo TARGETNAME=!COMPONENT_NAME!!COMPONENT_VER_MJ!!COMPONENT_VER_MN!>makefile
endlocal
echo !IFNDEF FREEBUILD>>makefile
echo TARGETNAME=$(TARGETNAME)d>>makefile
echo !ENDIF>>makefile
echo !INCLUDE $(NTMAKEENV)\makefile.def>>makefile
—8<--------------------------------------------------------------------------------------------------->8—
Then a product if using any of libraries
should have a “source” file like this one
—8<--------------------------------------------------------------------------------------------------->8—…
TARGETLIBS=\dev\lib\kern\cache_1_2d.lib
or
TARGETLIBS=\dev\lib\kern\cache_1_2.lib
etc.
—8<--------------------------------------------------------------------------------------------------->8—
But just I want to specify
—8<--------------------------------------------------------------------------------------------------->8—
…
LINKER_FLAGS=$(LINKER_FLAGS) /LIBPATH:\dev\lib\kern
…
—8<--------------------------------------------------------------------------------------------------->8—
and to write the name in the header (using pragma comment lib…)
But I can’t …because…
“/NODEFAULTLIB option tells the linker to remove one or more default libraries from the list of libraries” (I got that info from the log, of course;)
I appreciate your ideas and experience, but I just want to get the way of disabling /NODEFAULTLIB
(and maybe env variable LIB which linker also uses for crt, etc…)