## Compatibility layers
### Checks for libraries
-EFL_INTERNAL_DEPEND_PKG([EOLIAN], [eina])
-EFL_INTERNAL_DEPEND_PKG([EOLIAN], [eo])
+EFL_INTERNAL_DEPEND_PKG([EOLIAN_CXX], [eina])
+EFL_INTERNAL_DEPEND_PKG([EOLIAN_CXX], [eo])
### Checks for header files
std::string filename, namespace_;
std::tie(filename, namespace_) = get_filename_info(eo_parent_file);
// we have our own eo_base.hh
- if (filename != "eo_base.eo" || namespace_ != "eo")
+ std::string eo_base_eo = "eo_base.eo";
+ if (filename.length() < eo_base_eo.length() ||
+ !std::equal(eo_base_eo.begin(), eo_base_eo.end(),
+ filename.end() - eo_base_eo.length()))
{
- gen_opts.cxx_headers.push_back(filename + ".hh");
+ gen_opts.cxx_headers.push_back(filename + ".hh");
}
}
else
MAINTAINERCLEANFILES = Makefile.in
AM_CXXFLAGS = \
- -I. \
+ -I$(srcdir) \
+ -I$(builddir) \
-I$(top_builddir)/src/lib/efl \
-I$(top_srcdir)/src/lib/eina \
-I$(top_builddir)/src/lib/eina \
-L$(top_builddir)/src/lib/evas \
-L$(top_builddir)/src/lib/ecore \
-L$(top_builddir)/src/lib/ecore_evas \
- -leina -levas -leo -lecore -lecore_evas
+ -leina -levas -leo -lecore -lecore_evas -pthread
LDADD = \
$(top_builddir)/src/lib/eo/libeo.la \
colourable.eo \
colourablesquare.eo
+IMPL = \
+ colourable.c \
+ colourablesquare.c
+
SRCS = \
eolian_cxx_simple_01.cc \
- eolian_cxx_inherit_01.cc
+ eolian_cxx_inherit_01.cc \
+ $(IMPL)
EXTRA_PROGRAMS = \
eolian_cxx_simple_01 \
eolian_cxx_inherit_01
+DATA_FILES = Makefile.examples $(EOS)
CLEANFILES =
-eolian_cxx_simple_01_SOURCES = \
- eolian_cxx_simple_01.cc \
- colourable.c \
- colourablesquare.c
+eolian_cxx_simple_01_SOURCES = eolian_cxx_simple_01.cc $(IMPL)
+eolian_cxx_simple_01_DEPENDENCIES = $(GENERATED)
-eolian_cxx_inherit_01_SOURCES = \
- eolian_cxx_inherit_01.cc \
- colourable.c \
- colourablesquare.c
+eolian_cxx_inherit_01_SOURCES = eolian_cxx_inherit_01.cc $(IMPL)
+eolian_cxx_inherit_01_DEPENDENCIES = $(GENERATED)
EOLIAN_GEN = $(top_builddir)/src/bin/eolian/eolian_gen${EXEEXT}
EOLIAN_CXX = $(top_builddir)/src/bin/eolian_cxx/eolian_cxx${EXEEXT}
SUFFIXES = .eo .eo.c .eo.h .eo.hh
%.eo.hh: %.eo $(EOLIAN_CXX)
- $(AM_V_EOLCXX)$(EOLIAN_CXX) $(EOLIAN_FLAGS) -I$< -o $@
+ $(AM_V_EOLCXX)$(EOLIAN_CXX) $(EOLIAN_FLAGS) -I./$< -o $@
%.eo.c: %.eo $(EOLIAN_GEN)
$(AM_V_EOL)$(EOLIAN_GEN) --eo --legacy $(EOLIAN_FLAGS) --gc -o $@ $<
--- /dev/null
+
+CXX=g++
+CC=gcc
+EOLIAN_GEN=eolian_gen
+EOLIAN_CXX=eolian_cxx
+COMMON_FLAGS=`pkg-config --libs --cflags eina,ecore,evas,ecore-evas,emotion,eolian,eolian-cxx,eo-cxx,eina-cxx` -DEFL_BETA_API_SUPPORT
+EOLIAN_FLAGS=`pkg-config --variable=eolian_flags eo` -I.
+
+EOS = colourable.eo colourablesquare.eo
+
+IMPL = colourable.c colourablesquare.c
+
+GENERATED = \
+ colourable.eo.c \
+ colourable.eo.h \
+ colourable.eo.hh \
+ colourablesquare.eo.c \
+ colourablesquare.eo.h \
+ colourablesquare.eo.hh
+
+EXAMPLES= eolian_cxx_inherit_01 \
+ eolian_cxx_simple_01
+
+OBJS = colourable.o colourablesquare.o
+
+all: $(OBJS) examples
+
+codegen:
+ $(EOLIAN_CXX) $(EOLIAN_FLAGS) -I./colourable.eo -o colourable.eo.hh
+ $(EOLIAN_CXX) $(EOLIAN_FLAGS) -I./colourablesquare.eo -o colourablesquare.eo.hh
+ $(EOLIAN_GEN) --eo --legacy $(EOLIAN_FLAGS) --gc -o colourable.eo.c colourable.eo
+ $(EOLIAN_GEN) --eo --legacy $(EOLIAN_FLAGS) --gc -o colourablesquare.eo.c colourablesquare.eo
+ $(EOLIAN_GEN) --eo $(EOLIAN_FLAGS) --gh -o colourable.eo.h colourable.eo
+ $(EOLIAN_GEN) --eo $(EOLIAN_FLAGS) --gh -o colourablesquare.eo.h colourablesquare.eo
+
+$(OBJS): codegen
+ $(CC) -c colourable.c $(COMMON_FLAGS)
+ $(CC) -c colourablesquare.c $(COMMON_FLAGS)
+
+examples: $(EXAMPLES)
+
+$(EXAMPLES):
+ $(CXX) -o $@ $@.cc $(OBJS) $(COMMON_FLAGS) -std=c++11
+
+clean:
+ @echo "Cleaning up built objects..."
+ @rm -Rf $(EXAMPLES)