--- /dev/null
+#
+# Copyright (c) 2014 Clerk Ma
+#
+# You may freely use, modify and/or distribute this file.
+#
+# makefile for linux (tested in ubuntu 14.04: gcc 4.8).
+# linked libkpathsea.a and libz.a
+# ./configure --prefix=/home/clerk/dev --host=arm-linux-androideabi
+#
+
+CC = arm-linux-androideabi-gcc
+CFLAGS = -c -O2 -Wno-unused-result -Ilibmd5 -I/home/clerk/android/include
+LDFLAGS = /home/clerk/android/lib/libkpathsea.a -lz
+
+objects = yandytex.o itex.o openinou.o subroute.o local.o \
+ tex0.o tex1.o tex2.o tex3.o tex4.o \
+ tex5.o tex6.o tex7.o tex8.o tex9.o \
+ pool.o md5.o utils.o
+
+headers = yandytex.h texd.h coerce.h macros.h memory.h
+
+yandytex: $(objects)
+ $(CC) -s -o yandytex $(objects) $(LDFLAGS)
+
+yandytex.o: yandytex.c $(headers)
+ $(CC) $(CFLAGS) yandytex.c
+
+itex.o: itex.c $(headers)
+ $(CC) $(CFLAGS) itex.c
+
+openinou.o: openinou.c $(headers)
+ $(CC) $(CFLAGS) openinou.c
+
+subroute.o: subroute.c $(headers)
+ $(CC) $(CFLAGS) subroute.c
+
+local.o: local.c $(headers)
+ $(CC) $(CFLAGS) local.c
+
+tex0.o: tex0.c $(headers)
+ $(CC) $(CFLAGS) tex0.c
+
+tex1.o: tex1.c $(headers)
+ $(CC) $(CFLAGS) tex1.c
+
+tex2.o: tex2.c $(headers)
+ $(CC) $(CFLAGS) tex2.c
+
+tex3.o: tex3.c $(headers)
+ $(CC) $(CFLAGS) tex3.c
+
+tex4.o: tex4.c $(headers)
+ $(CC) $(CFLAGS) tex4.c
+
+tex5.o: tex5.c $(headers)
+ $(CC) $(CFLAGS) tex5.c
+
+tex6.o: tex6.c $(headers)
+ $(CC) $(CFLAGS) tex6.c
+
+tex7.o: tex7.c $(headers)
+ $(CC) $(CFLAGS) tex7.c
+
+tex8.o: tex8.c $(headers)
+ $(CC) $(CFLAGS) tex8.c
+
+tex9.o: tex9.c $(headers)
+ $(CC) $(CFLAGS) tex9.c
+
+pool.o: pool.c $(headers)
+ $(CC) $(CFLAGS) pool.c
+
+md5.o: libmd5/md5.c $(headers)
+ $(CC) $(CFLAGS) libmd5/md5.c
+
+utils.o: utils.c $(headers)
+ $(CC) $(CFLAGS) utils.c
+
+.PHONY: clean
+
+clean:
+ rm yandytex *.o
#
# You may freely use, modify and/or distribute this file.
#
-# makefle for linux (tested in ubuntu 14.04: clang/LLVM 4.3).
+# makefile for linux (tested in ubuntu 14.04: clang/LLVM 4.3).
#
# apt-get install libkpathsea6 libkpathsea-dev
# apt-get install zlib1g zlib1g-dev
#
# You may freely use, modify and/or distribute this file.
#
-# makefle for linux (tested in ubuntu 14.04: gcc 4.8).
+# makefile for linux (tested in ubuntu 14.04: gcc 4.8).
#
# apt-get install libkpathsea6 libkpathsea-dev
# apt-get install zlib1g zlib1g-dev
#define REALLOC realloc
#endif
-#if defined(__clang__)
+#ifdef __ANDROID__
+ #define malloc_usable_size dlmalloc_usable_size
+#endif
+
+#if defined (__clang__)
const char * compiler = "Clang/LLVM";
-#elif defined(__GNUC__) || defined(__GNUG__)
+#elif defined (__GNUC__) || defined(__GNUG__)
const char * compiler = "GCC";
-#elif defined(_MSC_VER)
+#elif defined (_MSC_VER)
const char * compiler = "MSVC";
#endif
+#if defined (_WIN64)
+const char * dist = "Win64";
+#elif defined (_WIN32)
+const char * dist = "Win32";
+#elif defined (__ANDROID__)
+const char * dist = "Android";
+#elif defined (__APPLE__)
+const char * dist = "Darwin";
+#elif defined (__gnu_linux__)
+const char * dist = "Linux";
+#else
+const char * dist = "Unknown";
+#endif
+
const char * compiletime = __TIME__;
const char * compiledate = __DATE__;
const char * yandyversion = "2.3.0";
void print_banner (void)
{
char dist_ver[256];
-#ifdef _WIN32
-#ifdef _WIN64
- sprintf(dist_ver, "%s (%s %s/Win64)", banner, application, yandyversion);
-#else
- sprintf(dist_ver, "%s (%s %s/Win32)", banner, application, yandyversion);
-#endif
-#else
- sprintf(dist_ver, "%s (%s %s/Linux)", banner, application, yandyversion);
-#endif
+ sprintf(dist_ver, "%s (%s %s/%s)", banner, application, yandyversion, dist);
prints(dist_ver);
}
void show_usage (void)
{
printf("\n"
- "Useage: yanytex [OPTION]... [+format_file] [tex_file]\n\n"
+ "Useage: yandytex [OPTION]... [+format_file] [tex_file]\n\n"
"--help -? show this usage summary\n"
"--initex -i start up as initex (create format file)\n"
"--verbose -v be verbose (show implementation version number)\n"
return input_line_finish();
}
-/* This string specifies what the `e' option does in response to an
- error message. */
-
static char * edit_value = "c:\\yandy\\WinEdt\\WinEdt.exe [Open('%s');SelLine(%d,7)]";
-static int Isspace (char c)
+static inline int Isspace (char c)
{
return (c == ' ' || c == '\t');
}