Skip to content
Permalink
Browse files

patch 8.1.1578: MS-Windows: pathdef.c should depend on build options

Problem:    MS-Windows: pathdef.c should depend on build options.
Solution:   Generate pathdef.c in the object directory.  Fix dependencies.
            (Ken Takata, closes #4565)
  • Loading branch information...
brammool committed Jun 21, 2019
1 parent 693f7dc commit dfc145572813c5d3848feb4029ff8bfb127ab66a
Showing with 34 additions and 26 deletions.
  1. +3 −1 .gitignore
  2. +3 −1 .hgignore
  3. +25 −20 src/Make_cyg_ming.mak
  4. +1 −4 src/Make_mvc.mak
  5. +2 −0 src/version.c
@@ -35,7 +35,9 @@ src/auto/pathdef.c
*.RES
vim*.dll
vim*.lib
src/pathdef.c
src/dobj*/pathdef.c
src/gobj*/pathdef.c
src/obj*/pathdef.c
src/Obj*/pathdef.c
gvimext.dll
gvimext.lib
@@ -37,7 +37,9 @@ src/auto/pathdef.c
*.RES
vim*.dll
vim*.lib
src/pathdef.c
src/dobj*/pathdef.c
src/gobj*/pathdef.c
src/obj*/pathdef.c
src/Obj*/pathdef.c
gvimext.dll
gvimext.lib
@@ -1048,9 +1048,9 @@ notags:
clean:
-$(DEL) $(OUTDIR)$(DIRSLASH)*.o
-$(DEL) $(OUTDIR)$(DIRSLASH)*.res
-$(DEL) $(OUTDIR)$(DIRSLASH)pathdef.c
-rmdir $(OUTDIR)
-$(DEL) $(MAIN_TARGET) vimrun.exe install.exe uninstal.exe
-$(DEL) pathdef.c
ifdef PERL
-$(DEL) if_perl.c
-$(DEL) auto$(DIRSLASH)if_perl.c
@@ -1072,6 +1072,8 @@ GUI_INCL += gui_dwrite.h
endif
CUI_INCL = iscygpty.h

PATHDEF_SRC = $(OUTDIR)/pathdef.c

$(OUTDIR)/if_python.o: if_python.c if_py_both.h $(INCL)
$(CC) -c $(CFLAGS) $(PYTHONINC) $(PYTHON_HOME_DEF) $< -o $@

@@ -1171,6 +1173,9 @@ $(OUTDIR)/regexp.o: regexp.c regexp_nfa.c $(INCL)
$(OUTDIR)/terminal.o: terminal.c $(INCL) $(TERM_DEPS)
$(CC) -c $(CFLAGS) terminal.c -o $@

$(OUTDIR)/pathdef.o: $(PATHDEF_SRC) $(INCL)
$(CC) -c $(CFLAGS) $(PATHDEF_SRC) -o $@


CCCTERM = $(CC) -c $(CFLAGS) -Ilibvterm/include -DINLINE="" \
-DVSNPRINTF=vim_vsnprintf \
@@ -1185,27 +1190,27 @@ $(OUTDIR)/%.o : xdiff/%.c $(XDIFF_DEPS)
$(CC) -c $(CFLAGS) $< -o $@


pathdef.c: $(INCL)
$(PATHDEF_SRC): Make_cyg_ming.mak Make_cyg.mak Make_ming.mak
ifneq (sh.exe, $(SHELL))
@echo creating pathdef.c
@echo '/* pathdef.c */' > pathdef.c
@echo '#include "vim.h"' >> pathdef.c
@echo 'char_u *default_vim_dir = (char_u *)"$(VIMRCLOC)";' >> pathdef.c
@echo 'char_u *default_vimruntime_dir = (char_u *)"$(VIMRUNTIMEDIR)";' >> pathdef.c
@echo 'char_u *all_cflags = (char_u *)"$(CC) $(CFLAGS)";' >> pathdef.c
@echo 'char_u *all_lflags = (char_u *)"$(LINK) $(CFLAGS) $(LFLAGS) -o $(TARGET) $(LIB) -lole32 -luuid $(LUA_LIB) $(MZSCHEME_LIBDIR) $(MZSCHEME_LIB) $(PYTHONLIB) $(PYTHON3LIB) $(RUBYLIB)";' >> pathdef.c
@echo 'char_u *compiled_user = (char_u *)"$(USERNAME)";' >> pathdef.c
@echo 'char_u *compiled_sys = (char_u *)"$(USERDOMAIN)";' >> pathdef.c
@echo creating $(PATHDEF_SRC)
@echo '/* pathdef.c */' > $(PATHDEF_SRC)
@echo '#include "vim.h"' >> $(PATHDEF_SRC)
@echo 'char_u *default_vim_dir = (char_u *)"$(VIMRCLOC)";' >> $(PATHDEF_SRC)
@echo 'char_u *default_vimruntime_dir = (char_u *)"$(VIMRUNTIMEDIR)";' >> $(PATHDEF_SRC)
@echo 'char_u *all_cflags = (char_u *)"$(CC) $(CFLAGS)";' >> $(PATHDEF_SRC)
@echo 'char_u *all_lflags = (char_u *)"$(LINK) $(CFLAGS) $(LFLAGS) -o $(TARGET) $(LIB) -lole32 -luuid $(LUA_LIB) $(MZSCHEME_LIBDIR) $(MZSCHEME_LIB) $(PYTHONLIB) $(PYTHON3LIB) $(RUBYLIB)";' >> $(PATHDEF_SRC)
@echo 'char_u *compiled_user = (char_u *)"$(USERNAME)";' >> $(PATHDEF_SRC)
@echo 'char_u *compiled_sys = (char_u *)"$(USERDOMAIN)";' >> $(PATHDEF_SRC)
else
@echo creating pathdef.c
@echo /* pathdef.c */ > pathdef.c
@echo #include "vim.h" >> pathdef.c
@echo char_u *default_vim_dir = (char_u *)"$(VIMRCLOC)"; >> pathdef.c
@echo char_u *default_vimruntime_dir = (char_u *)"$(VIMRUNTIMEDIR)"; >> pathdef.c
@echo char_u *all_cflags = (char_u *)"$(CC) $(CFLAGS)"; >> pathdef.c
@echo char_u *all_lflags = (char_u *)"$(CC) $(CFLAGS) $(LFLAGS) -o $(TARGET) $(LIB) -lole32 -luuid $(LUA_LIB) $(MZSCHEME_LIBDIR) $(MZSCHEME_LIB) $(PYTHONLIB) $(PYTHON3LIB) $(RUBYLIB)"; >> pathdef.c
@echo char_u *compiled_user = (char_u *)"$(USERNAME)"; >> pathdef.c
@echo char_u *compiled_sys = (char_u *)"$(USERDOMAIN)"; >> pathdef.c
@echo creating $(PATHDEF_SRC)
@echo /* pathdef.c */ > $(PATHDEF_SRC)
@echo #include "vim.h" >> $(PATHDEF_SRC)
@echo char_u *default_vim_dir = (char_u *)"$(VIMRCLOC)"; >> $(PATHDEF_SRC)
@echo char_u *default_vimruntime_dir = (char_u *)"$(VIMRUNTIMEDIR)"; >> $(PATHDEF_SRC)
@echo char_u *all_cflags = (char_u *)"$(CC) $(CFLAGS)"; >> $(PATHDEF_SRC)
@echo char_u *all_lflags = (char_u *)"$(CC) $(CFLAGS) $(LFLAGS) -o $(TARGET) $(LIB) -lole32 -luuid $(LUA_LIB) $(MZSCHEME_LIBDIR) $(MZSCHEME_LIB) $(PYTHONLIB) $(PYTHON3LIB) $(RUBYLIB)"; >> $(PATHDEF_SRC)
@echo char_u *compiled_user = (char_u *)"$(USERNAME)"; >> $(PATHDEF_SRC)
@echo char_u *compiled_sys = (char_u *)"$(USERDOMAIN)"; >> $(PATHDEF_SRC)
endif

# vim: set noet sw=8 ts=8 sts=0 wm=0 tw=0:
@@ -1702,7 +1702,7 @@ E0_LINKARGS2 = $(LINKARGS2:\=\\)
E_LINKARGS2 = $(E0_LINKARGS2:"=\")
# ") stop the string

$(PATHDEF_SRC): auto
$(PATHDEF_SRC): Make_mvc.mak
@echo creating $(PATHDEF_SRC)
@echo /* pathdef.c */ > $(PATHDEF_SRC)
@echo #include "vim.h" >> $(PATHDEF_SRC)
@@ -1713,9 +1713,6 @@ $(PATHDEF_SRC): auto
@echo char_u *compiled_user = (char_u *)"$(USERNAME)"; >> $(PATHDEF_SRC)
@echo char_u *compiled_sys = (char_u *)"$(USERDOMAIN)"; >> $(PATHDEF_SRC)

auto:
if not exist auto/nul mkdir auto

# End Custom Build
proto.h: \
proto/arabic.pro \
@@ -777,6 +777,8 @@ static char *(features[]) =

static int included_patches[] =
{ /* Add new patch number below this line */
/**/
1578,
/**/
1577,
/**/

0 comments on commit dfc1455

Please sign in to comment.
You can’t perform that action at this time.