Improve of the rules + comments + headers
[scilab.git] / scilab / modules / jit / Makefile.in
index b93fb6a..e4f15d6 100644 (file)
@@ -560,6 +560,9 @@ testControlExp_SOURCES = src/cpp/testControlExp.cpp
 testControlExp_CXXFLAGS = $(check_INCLUDES)
 testControlExp_LDADD = $(check_LDADD)
 
+# This target transforms a basic code to llvm + clang code for the JIT
+BUILT_SOURCES = src/cpp/llvm-wrapper-generated.cpp
+
 # Where all the Scilab stuff is installed (macros, help, ...)
 mydatadir = $(pkgdatadir)/modules/$(modulename)
 
@@ -632,7 +635,8 @@ JARMASK = *.jar
 HELP_CHAPTERDIR = help/
 HELP_CHAPTERFILE = addchapter.sce
 HELP_CHAPTERLANG = en_US fr_FR pt_BR
-all: all-am
+all: $(BUILT_SOURCES)
+       $(MAKE) $(AM_MAKEFLAGS) all-am
 
 .SUFFIXES:
 .SUFFIXES: .sci .bin .cpp .lo .o .obj
@@ -861,13 +865,15 @@ distdir: $(DISTFILES)
        done
 check-am: all-am
        $(MAKE) $(AM_MAKEFLAGS) check-local
-check: check-am
+check: $(BUILT_SOURCES)
+       $(MAKE) $(AM_MAKEFLAGS) check-am
 all-am: Makefile $(LTLIBRARIES) $(HEADERS) all-local
 installdirs:
        for dir in "$(DESTDIR)$(pkglibdir)" "$(DESTDIR)$(libscijit_la_includedir)"; do \
          test -z "$$dir" || $(MKDIR_P) "$$dir"; \
        done
-install: install-am
+install: $(BUILT_SOURCES)
+       $(MAKE) $(AM_MAKEFLAGS) install-am
 install-exec: install-exec-am
 install-data: install-data-am
 uninstall: uninstall-am
@@ -897,6 +903,7 @@ distclean-generic:
 maintainer-clean-generic:
        @echo "This command is intended for maintainers to use"
        @echo "it deletes files that may require special tools to rebuild."
+       -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
 clean: clean-am
 
 clean-am: clean-generic clean-libtool clean-local \
@@ -970,7 +977,7 @@ ps-am:
 uninstall-am: uninstall-libscijit_la_includeHEADERS \
        uninstall-pkglibLTLIBRARIES
 
-.MAKE: check-am install-am install-strip
+.MAKE: all check check-am install install-am install-strip
 
 .PHONY: CTAGS GTAGS TAGS all all-am all-local check check-am \
        check-local clean clean-generic clean-libtool clean-local \
@@ -990,6 +997,8 @@ uninstall-am: uninstall-libscijit_la_includeHEADERS \
        uninstall-am uninstall-libscijit_la_includeHEADERS \
        uninstall-pkglibLTLIBRARIES
 
+src/cpp/llvm-wrapper-generated.cpp: src/cpp/llvm-wrapper.cpp
+       clang++ -emit-llvm  -I$(top_srcdir)/modules/types/includes/ -I$(top_srcdir)/modules/operations/includes/ -I$(top_srcdir)/modules/core/includes/  -I$(top_srcdir)/modules/ast/includes/ -I$(top_srcdir)/modules/localization/includes/ $(EIGEN_CPPFLAGS) -c src/cpp/llvm-wrapper.cpp -o - | llc -march=cpp -cppgen=contents -o src/cpp/llvm-wrapper-generated.cpp
 
 # This target enables tests for Scilab
 check-local: $(top_builddir)/scilab-bin test