-
Notifications
You must be signed in to change notification settings - Fork 624
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move all parsers C code to parsers directory #286
Conversation
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
In general I like the idea, but the PR as it is right now completely break all compiling on Windows. It becomes a long command to type just to compile using Cygwin or cross-compile on Linux, but that is not the big issue. Both make variants can't find the files it needs:
Compiling with MSVC command line compiler doesn't work for basically the same reason.
And the Visual Studio project files needs to be patched as well. What do you suggest to solve these issues? A patch for the project files is a bit of work, but easy since that is complete independent from the makefiles. A patch for the mk_mingw.mak is not difficult as well. It uses GNU make, so VPATH can be used as well. Have to think about mk_mvc.mak though. nmake has no support for VPATH and adjusting sources.mak would break all the other builds. |
And we I will try to create a patch for travis as well. But for that mk_mingw.mak needs to work properly again. |
I've created a patch for mk_mingw.mak. What is the easiest way to get this into your PR? Should I e-mail you the output of |
About building with MSVC... I think we should remove mk_mvc.mak. It appears to be quite a job to get that to work with this new directory structure. And when the Visual Studio project files are updated |
And did you just oversee |
Patches for Visual Studio project files and travis are ready as well. |
IMO we should just properly prefix all relevant entries in source.mak with |
…which is a little more subtle than what I initially thought as the current build rule in |
This works (given perl.c and rust.c are moved into parsers/) diff --git a/Makefile.in b/Makefile.in
index 9efeae6..37764c8 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -27,6 +27,7 @@ pkgconfdir=@sysconfdir@/@PACKAGE_NAME@
libexecdir=@libexecdir@
pkglibexecdir=@libexecdir@/@PACKAGE_NAME@
SLINK = @LN_S@
+MKDIR_P = @MKDIR_P@
STRIP = @STRIP@
CC = @CC@
DEFS = @DEFS@
@@ -68,7 +69,7 @@ include $(srcdir)/makefiles/source.mak
.SUFFIXES:
.SUFFIXES: .c .$(OBJEXT)
-VPATH = $(srcdir) $(srcdir)/parsers $(srcdir)/data/corpora \
+VPATH = $(srcdir) $(srcdir)/data/corpora \
$(srcdir)/data/optlib $(srcdir)/gnu_regex $(srcdir)/fnmatch
INSTALL = cp -p
@@ -347,7 +348,8 @@ maintainerclean: distclean
# implicit rules
#
.c.$(OBJEXT):
- $(CC) -I. -I$(srcdir) $(DEFS) $(ALL_CPPFLAGS) $(ALL_CFLAGS) -c $<
+ dir="$$(dirname $@)"; [ -d "$$dir" ] || $(MKDIR_P) "$$dir"
+ $(CC) -I. -I$(srcdir) $(DEFS) $(ALL_CPPFLAGS) $(ALL_CFLAGS) -o $@ -c $<
$(addsuffix .$(OBJEXT),$(basename $(notdir $(REGEX_SOURCES)))): ALL_CPPFLAGS += \
-D_GNU_SOURCE -D__USE_GNU -Dbool=int -Dfalse=0 -Dtrue=1
diff --git a/configure.ac b/configure.ac
index 28ad6da..8544fb3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -263,6 +263,7 @@ case `uname` in
esac
AC_PROG_LN_S
+AC_PROG_MKDIR_P
AC_CHECK_PROG(STRIP, strip, strip, :)
AC_SYS_LARGEFILE
diff --git a/makefiles/source.mak b/makefiles/source.mak
index 5f3e19b..ef8702e 100644
--- a/makefiles/source.mak
+++ b/makefiles/source.mak
@@ -5,72 +5,75 @@ HEADERS = \
main.h options.h parse.h parsers.h pcoproc.h read.h routines.h sort.h \
strlist.h trashbox.h vstring.h
+PARSER_SOURCES = \
+ parsers/ada.c \
+ parsers/ant.c \
+ parsers/asm.c \
+ parsers/asp.c \
+ parsers/awk.c \
+ parsers/basic.c \
+ parsers/beta.c \
+ parsers/c.c \
+ parsers/clojure.c \
+ parsers/css.c \
+ parsers/cobol.c \
+ parsers/dosbatch.c \
+ parsers/eiffel.c \
+ parsers/erlang.c \
+ parsers/falcon.c \
+ parsers/flex.c \
+ parsers/fortran.c \
+ parsers/go.c \
+ parsers/html.c \
+ parsers/jscript.c \
+ parsers/json.c \
+ parsers/lisp.c \
+ parsers/lua.c \
+ parsers/make.c \
+ parsers/matlab.c \
+ parsers/objc.c \
+ parsers/ocaml.c \
+ parsers/pascal.c \
+ parsers/perl.c \
+ parsers/php.c \
+ parsers/python.c \
+ parsers/rexx.c \
+ parsers/ruby.c \
+ parsers/rust.c \
+ parsers/scheme.c \
+ parsers/sh.c \
+ parsers/slang.c \
+ parsers/sml.c \
+ parsers/sql.c \
+ parsers/tcl.c \
+ parsers/tex.c \
+ parsers/verilog.c \
+ parsers/vhdl.c \
+ parsers/vim.c \
+ parsers/windres.c \
+ parsers/yacc.c
+
SOURCES = \
- ada.c \
args.c \
- ant.c \
- asm.c \
- asp.c \
- awk.c \
- basic.c \
- beta.c \
- c.c \
- clojure.c \
- css.c \
- cobol.c \
- dosbatch.c \
- eiffel.c \
entry.c \
- erlang.c \
- falcon.c \
flags.c \
- flex.c \
- fortran.c \
get.c \
- go.c \
- html.c \
htable.c \
- jscript.c \
- json.c \
keyword.c \
- lisp.c \
lregex.c \
- lua.c \
lxcmd.c \
main.c \
- make.c \
- matlab.c \
- objc.c \
- ocaml.c \
options.c \
parse.c \
- pascal.c \
pcoproc.c \
- perl.c \
- php.c \
- python.c \
read.c \
- rexx.c \
routines.c \
- ruby.c \
- rust.c \
- scheme.c \
- sh.c \
- slang.c \
- sml.c \
sort.c \
- sql.c \
strlist.c \
- tcl.c \
- tex.c \
tg.c \
trashbox.c \
- verilog.c \
- vhdl.c \
- vim.c \
- windres.c \
- yacc.c \
- vstring.c
+ vstring.c \
+ $(PARSER_SOURCES)
ENVIRONMENT_HEADERS = e_msoft.h
|
Thank you for comments. I should have more tests. @ffes, @b4n, could directory push your code about this topic to the branch? |
I just pushed my commits to the fishman/sepdir branch. It builds again with mk_mingw.mak and with Visual Studio IDE and MSBuild. |
Maybe a suggestion - it would be nice to have also the rest of the sources outside the root (having them mixed with all the READMEs etc. is a bit messy and hard to find the actual source file). One possibility would be having directories src - non-parser sources would be here or something similar. |
Pushed to master. |
@masatake Thanks, sounds good to me. |
I will apply the patch submitted by @b4n after merging sepdir-core branch. |
This is the initial step for solving #63.
All concrete parsers are moved to parsers directory.
This directory structure may help up to merge/share the code with geany.