diff --git a/README.md b/README.md index 9504b43..ddf85fb 100644 --- a/README.md +++ b/README.md @@ -79,8 +79,8 @@ The kind of output your makefile produces depends on the extension in * `.dll` for a dynamic library The build commands for each case are defined in build environment -configurations, e.g. `config.gnu.mk`, by variables called `MAKE_EXE`, -`MAKE_LIB` and `MAKE_DLL`. The actual extension being used are also +configurations, e.g. `config.gnu.mk`, by variables called `LINK.exe`, +`LINK.lib` and `LINK.dll`. The actual extension being used are also defined in the same file, as `EXT.exe`, `EXT.lib` and `EXT.dll`. For example, on Linux, `EXT.lib` is set to `.a`. diff --git a/config.gnu.mk b/config.gnu.mk index 68d8052..cd6ec5e 100644 --- a/config.gnu.mk +++ b/config.gnu.mk @@ -150,32 +150,35 @@ LDFLAGS_RPATH= -Wl,-rpath,$(PREFIX_DLL) ifdef LIBTOOL MIQ_COMPILE= $(LIBTOOL) --silent --mode=compile MIQ_LINK= $(LIBTOOL) --silent --mode=link -MAKE_CC= $(MIQ_COMPILE) $(CC) $(MIQ_CFLAGS) -c $< -o $@ -MAKE_CXX= $(MIQ_COMPILE) $(CXX) $(MIQ_CXXFLAGS) -c $< -o $@ -MAKE_AS= $(MIQ_COMPILE) $(CC) $(MIQ_CFLAGS) -c $< -o $@ -MAKE_LIB= $(MIQ_LINK) $(LD) $(MIQ_LDFLAGS) $(MIQ_LINKARGS) \ +COMPILE.c= $(MIQ_COMPILE) $(CC) $(MIQ_CFLAGS) -c $< -o $@ +COMPILE.cpp= $(MIQ_COMPILE) $(CXX) $(MIQ_CXXFLAGS) -c $< -o $@ +COMPILE.s= $(MIQ_COMPILE) $(CC) $(MIQ_CFLAGS) -c $< -o $@ +LINK.lib= $(MIQ_LINK) $(LD) $(MIQ_LDFLAGS) $(MIQ_LINKARGS) \ -o $@ \ $(MIQ_LT_VERS_OPT) -MAKE_DLL= $(MAKE_LIB) -INSTALL_DLL= $(LIBTOOL) --silent --mode=install \ +LINK.dll= $(LINK.lib) +INSTALL.dll= $(LIBTOOL) --silent --mode=install \ $(INSTALL) $(MIQ_DLLNAME) $(PACKAGE_INSTALL_DLL) -MAKE_EXE= $(MIQ_LINK) $(LD) $(MIQ_LINKARGS) $(MIQ_LDFLAGS) -o $@ +LINK.exe= $(MIQ_LINK) $(LD) $(MIQ_LINKARGS) $(MIQ_LDFLAGS) -o $@ else # Non-libtool case: manage manually CFLAGS_PIC= -fPIC -MAKE_CC= $(CC) $(MIQ_CFLAGS) -c $< -o $@ -MAKE_CXX= $(CXX) $(MIQ_CXXFLAGS) -c $< -o $@ -MAKE_AS= $(CC) $(MIQ_CFLAGS) -c $< -o $@ -MAKE_LIB= $(AR) $@ $(MIQ_TOLINK) && $(RANLIB) $@ -MAKE_DLL= $(LD) -shared $(MIQ_LINKARGS) $(MIQ_LDFLAGS) \ +COMPILE.c= $(CC) $(MIQ_CFLAGS) -c $< -o $@ +COMPILE.cpp= $(CXX) $(MIQ_CXXFLAGS) -c $< -o $@ +COMPILE.s= $(CC) $(MIQ_CFLAGS) -c $< -o $@ +LINK.lib= $(AR) $@ $(MIQ_TOLINK) && $(RANLIB) $@ +LINK.dll= $(LD) -shared $(MIQ_LINKARGS) $(MIQ_LDFLAGS) \ -o $(MIQ_DLLNAME) \ $(MIQ_SONAME_OPT) \ && (cd $(OUTPUT) $(MIQ_SYMLINKS)) -INSTALL_DLL= $(INSTALL) $(MIQ_DLLNAME) $(PACKAGE_INSTALL_DLL) \ +INSTALL.dll= $(INSTALL) $(MIQ_DLLNAME) $(PACKAGE_INSTALL_DLL) \ && (cd $(PACKAGE_INSTALL_DLL) $(MIQ_SYMLINKS)) -MAKE_EXE= $(LD) $(MIQ_LINKARGS) $(MIQ_LDFLAGS) -o $@ +LINK.exe= $(LD) $(MIQ_LINKARGS) $(MIQ_LDFLAGS) -o $@ endif +COMPILE.cc= $(COMPILE.cpp) +COMPILE.asm= $(COMPILE.s) + LINK_DIR_OPT= -L LINK_LIB_OPT= -l LINK_DLL_OPT= -l diff --git a/config.vs2013.mk b/config.vs2013.mk index af545dc..4af820c 100644 --- a/config.vs2013.mk +++ b/config.vs2013.mk @@ -128,13 +128,14 @@ LINK_DLL_OPT=-l: # In order to merge all .pdb information for an executable, we need to pass the -debug # option to the linker. -MAKE_CC= $(CC) $(MIQ_CFLAGS) -c -Fo$@ $< -MAKE_CXX= $(CXX) $(MIQ_CXXFLAGS) -c -Fo$@ $< +COMPILE.c= $(CC) $(MIQ_CFLAGS) -c -Fo$@ $< +COMPILE.cpp= $(CXX) $(MIQ_CXXFLAGS) -c -Fo$@ $< +COMPILE.cc= $(COMPILE.cpp) MAKE_DIR= mkdir -p $* MAKE_OBJDIR= $(MAKE_DIR) && touch $@ -MAKE_LIB= $(MSLIB) $(MIQ_LINKOPTS) -out:$@ -MAKE_DLL= $(LD) $(MIQ_LINKOPTS) $(MIQ_LDFLAGS) -dll -out:$@ -MAKE_EXE= $(LD) $(MIQ_LINKOPTS) $(MIQ_LDFLAGS) -out:$@ +LINK.lib= $(MSLIB) $(MIQ_LINKOPTS) -out:$@ +LINK.dll= $(LD) $(MIQ_LINKOPTS) $(MIQ_LDFLAGS) -dll -out:$@ +LINK.exe= $(LD) $(MIQ_LINKOPTS) $(MIQ_LDFLAGS) -out:$@ #------------------------------------------------------------------------------ diff --git a/rules.mk b/rules.mk index f567ffe..9959801 100644 --- a/rules.mk +++ b/rules.mk @@ -461,15 +461,15 @@ endif # Compilation $(MIQ_OBJDIR)%.c$(EXT.obj): %.c $(MIQ_OBJDEPS) - $(PRINT_COMPILE) $(MAKE_CC) + $(PRINT_COMPILE) $(COMPILE.c) $(MIQ_OBJDIR)%.cpp$(EXT.obj): %.cpp $(MIQ_OBJDEPS) - $(PRINT_COMPILE) $(MAKE_CXX) + $(PRINT_COMPILE) $(COMPILE.cpp) $(MIQ_OBJDIR)%.cc$(EXT.obj): %.cc $(MIQ_OBJDEPS) - $(PRINT_COMPILE) $(MAKE_CXX) + $(PRINT_COMPILE) $(COMPILE.cc) $(MIQ_OBJDIR)%.s$(EXT.obj): %.s $(MIQ_OBJDEPS) - $(PRINT_COMPILE) $(MAKE_AS) + $(PRINT_COMPILE) $(COMPILE.s) $(MIQ_OBJDIR)%.asm$(EXT.obj): %.asm $(MIQ_OBJDEPS) - $(PRINT_COMPILE) $(MAKE_AS) + $(PRINT_COMPILE) $(COMPILE.asm) # Skip headers $(MIQ_OBJDIR)%.h$(EXT.obj): @@ -493,11 +493,11 @@ MIQ_NOLIB= $(MIQ_NOEXE:$(PFX.lib)%$(EXT.lib)=%) MIQ_NODLL= $(MIQ_NOLIB:$(PFX.dll)%$(EXT.dll)=%) MIQ_OUT_SOURCES=$(SOURCES_$(MIQ_NODLL)) $(MIQ_OUTLIB): $(MIQ_TOLINK) $$(MIQ_TOLINK) $(MIQ_MAKEDEPS) - $(PRINT_BUILD) $(MAKE_LIB) + $(PRINT_BUILD) $(LINK.lib) $(MIQ_OUTDLL): $(MIQ_TOLINK) $$(MIQ_TOLINK) $(MIQ_MAKEDEPS) - $(PRINT_BUILD) $(MAKE_DLL) + $(PRINT_BUILD) $(LINK.dll) $(MIQ_OUTEXE): $(MIQ_TOLINK) $$(MIQ_TOLINK) $(MIQ_MAKEDEPS) - $(PRINT_BUILD) $(MAKE_EXE) + $(PRINT_BUILD) $(LINK.exe) #------------------------------------------------------------------------------ # Package configuration