squash: tidy up the mkdirs

This commit is contained in:
Michael Savage 2017-01-05 16:33:51 +02:00
parent d42c5fc422
commit a4bfb70876
2 changed files with 10 additions and 14 deletions

View File

@ -173,17 +173,20 @@
-- it screws up the escaping of spaces and parethesis (anyone know a fix?)
--
function make.mkdirRules(dirname)
_p('%s:', dirname)
_p('\t@echo Creating %s', dirname)
function make.mkdir(dirname)
_p('ifeq (posix,$(SHELLTYPE))')
_p('\t$(SILENT) mkdir -p %s', dirname)
_p('else')
_p('\t$(SILENT) mkdir $(subst /,\\\\,%s)', dirname)
_p('endif')
_p('')
end
function make.mkdirRules(dirname)
_p('%s:', dirname)
_p('\t@echo Creating %s', dirname)
make.mkdir(dirname)
_p('')
end
--
-- Format a list of values to be safely written as part of a variable assignment.

View File

@ -153,17 +153,14 @@
if path.iscppfile(node.abspath) then
_x('$(OBJDIR)/%s.o: %s', node.objname, node.relpath)
_p('\t@echo $(notdir $<)')
_p('ifeq (posix,$(SHELLTYPE))')
_p('\t$(SILENT) mkdir -p "$(OBJDIR)"')
_p('else')
_p('\t$(SILENT) mkdir "$(subst /,\\\\,$(OBJDIR))"')
_p('endif')
make.mkdir('$(OBJDIR)')
cpp.buildcommand(prj, "o", node)
-- resource file
elseif path.isresourcefile(node.abspath) then
_x('$(OBJDIR)/%s.res: %s', node.objname, node.relpath)
_p('\t@echo $(notdir $<)')
make.mkdir('$(OBJDIR)')
_p('\t$(SILENT) $(RESCOMP) $< -O coff -o "$@" $(ALL_RESFLAGS)')
end
end
@ -370,11 +367,7 @@
function make.cppTargetRules(prj)
_p('$(TARGET): $(GCH) ${CUSTOMFILES} $(OBJECTS) $(LDDEPS) $(RESOURCES)')
_p('\t@echo Linking %s', prj.name)
_p('ifeq (posix,$(SHELLTYPE))')
_p('\t$(SILENT) mkdir -p "$(TARGETDIR)"')
_p('else')
_p('\t$(SILENT) mkdir "$(subst /,\\\\,$(TARGETDIR))"')
_p('endif')
make.mkdir('$(TARGETDIR)')
_p('\t$(SILENT) $(LINKCMD)')
_p('\t$(POSTBUILDCMDS)')
_p('')