Skip to content

Instantly share code, notes, and snippets.

@k-takata
Created November 16, 2020 05:54
Show Gist options
  • Save k-takata/236a3beaf298df2ad979187719ea5d00 to your computer and use it in GitHub Desktop.
Save k-takata/236a3beaf298df2ad979187719ea5d00 to your computer and use it in GitHub Desktop.
diff --git a/src/Make_cyg_ming.mak b/src/Make_cyg_ming.mak
--- a/src/Make_cyg_ming.mak
+++ b/src/Make_cyg_ming.mak
@@ -177,6 +177,7 @@ CROSS_COMPILE = i586-pc-mingw32msvc-
endif
DEL = rm
MKDIR = mkdir -p
+TOUCH = touch
DIRSLASH = /
else
# normal (Windows) compilation:
@@ -205,10 +206,12 @@ CROSS_COMPILE =
ifneq (sh.exe, $(SHELL))
DEL = rm
MKDIR = mkdir -p
+TOUCH = touch
DIRSLASH = /
else
DEL = del
MKDIR = mkdir
+TOUCH = type NUL >
DIRSLASH = \\
endif
endif
@@ -1058,23 +1061,23 @@ install.exe: dosinst.c dosinst.h version
uninstall.exe: uninstall.c dosinst.h version.h
$(CC) $(CFLAGS) -o uninstall.exe uninstall.c $(LIB) -lole32
-$(OBJ): $(OUTDIR)
+$(OBJ): $(OUTDIR)/.dummy
-$(EXEOBJG): $(OUTDIR)
+$(EXEOBJG): $(OUTDIR)/.dummy
-$(EXEOBJC): $(OUTDIR)
+$(EXEOBJC): $(OUTDIR)/.dummy
ifeq ($(VIMDLL),yes)
-$(TARGET): $(OUTDIR) $(OBJ)
+$(TARGET): $(OUTDIR)/.dummy $(OBJ)
$(LINK) $(CFLAGS) $(LFLAGS) -o $@ $(OBJ) $(LIB) -lole32 -luuid -lgdi32 $(LUA_LIB) $(MZSCHEME_LIBDIR) $(MZSCHEME_LIB) $(PYTHONLIB) $(PYTHON3LIB) $(RUBYLIB)
-$(GVIMEXE): $(OUTDIR) $(EXEOBJG) $(VIMDLLBASE).dll
+$(GVIMEXE): $(OUTDIR)/.dummy $(EXEOBJG) $(VIMDLLBASE).dll
$(CC) -L. $(EXELFLAGS) -mwindows -o $@ $(EXEOBJG) -l$(VIMDLLBASE)
-$(VIMEXE): $(OUTDIR) $(EXEOBJC) $(VIMDLLBASE).dll
+$(VIMEXE): $(OUTDIR)/.dummy $(EXEOBJC) $(VIMDLLBASE).dll
$(CC) -L. $(EXELFLAGS) -o $@ $(EXEOBJC) -l$(VIMDLLBASE)
else
-$(TARGET): $(OUTDIR) $(OBJ)
+$(TARGET): $(OUTDIR)/.dummy $(OBJ)
$(LINK) $(CFLAGS) $(LFLAGS) -o $@ $(OBJ) $(LIB) -lole32 -luuid $(LUA_LIB) $(MZSCHEME_LIBDIR) $(MZSCHEME_LIB) $(PYTHONLIB) $(PYTHON3LIB) $(RUBYLIB)
endif
@@ -1105,6 +1108,7 @@ clean:
-$(DEL) $(OUTDIR)$(DIRSLASH)*.o
-$(DEL) $(OUTDIR)$(DIRSLASH)*.res
-$(DEL) $(OUTDIR)$(DIRSLASH)pathdef.c
+ -$(DEL) $(OUTDIR)$(DIRSLASH).dummy
-rmdir $(OUTDIR)
-$(DEL) $(MAIN_TARGET) vimrun.exe install.exe uninstall.exe
-$(DEL) *.map
@@ -1169,8 +1173,9 @@ else
--input-format=rc --output-format=coff -i vim.rc -o $@
endif
-$(OUTDIR):
- $(MKDIR) $(OUTDIR)
+$(OUTDIR)/.dummy:
+ -$(MKDIR) $(OUTDIR)
+ touch $@
$(OUTDIR)/buffer.o: buffer.c $(INCL) version.h
@@ -1289,7 +1294,7 @@ CCCTERM = $(CC) -c $(CFLAGS) -Ilibvterm/
$(CC) -c $(CFLAGS) $< -o $@
-$(PATHDEF_SRC): $(OUTDIR) Make_cyg_ming.mak Make_cyg.mak Make_ming.mak
+$(PATHDEF_SRC): $(OUTDIR)/.dummy Make_cyg_ming.mak Make_cyg.mak Make_ming.mak
ifneq (sh.exe, $(SHELL))
@echo creating $(PATHDEF_SRC)
@echo '/* pathdef.c */' > $(PATHDEF_SRC)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment