-TESTTARGET = letest
-GENTARGET = gendata
-
-CPPFLAGS += -DLE_USE_CMEMORY -I$(top_builddir)/common -I$(top_srcdir)/common -I$(top_srcdir)/layout -I$(top_srcdir)
-LIBS = $(LIBICULE) $(LIBICUUC) @LIBS@ @LIB_M@
+TESTTARGET = letest
+GENTARGET = gendata
+
+BUILDDIR := $(CURR_SRCCODE_FULL_DIR)/../../
+# Simplify the path for Unix
+BUILDDIR := $(BUILDDIR:test/cintltst/../../=)
+# Simplify the path for Windows
+BUILDDIR := $(BUILDDIR:test\\cintltst/../../=)
+# Simplify the path for Windows 98
+BUILDDIR := $(BUILDDIR:TEST\\CINTLTST/../../=)
+
+CPPFLAGS += -I$(top_srcdir)/common -I$(top_srcdir)/i18n -I$(top_srcdir)/tools/ctestfw -I$(top_srcdir)/tools/toolutil -I$(top_srcdir)/layoutex $(ICULE_CFLAGS)
+ifeq ($(USING_ICULEHB),no)
+CPPFLAGS+=-I$(top_srcdir)/layout
+endif
+DEFS += -D'U_TOPSRCDIR="$(top_srcdir)/"' -D'U_TOPBUILDDIR="$(BUILDDIR)"'
+LIBS = $(LIBICULX) $(LIBICULE) $(LIBICUUC) $(LIBICUI18N) $(LIBCTESTFW) $(LIBICUTOOLUTIL) $(DEFAULT_LIBS) $(LIB_M)