Recovered from cvs revision 2007-10-15 16:10:00
This commit is contained in:
parent
0541f78d5a
commit
861939a9c2
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: Awk.cpp,v 1.75 2007/10/13 17:25:30 bacon Exp $
|
||||
* $Id: Awk.cpp,v 1.77 2007/10/14 16:34:57 bacon Exp $
|
||||
*
|
||||
* {License}
|
||||
*/
|
||||
@ -919,7 +919,7 @@ void Awk::Run::stop () const
|
||||
bool Awk::Run::isStop () const
|
||||
{
|
||||
ASE_ASSERT (this->run != ASE_NULL);
|
||||
return ase_awk_isstop (this->run);
|
||||
return ase_awk_isstop (this->run)? true: false;
|
||||
}
|
||||
|
||||
Awk::ErrorCode Awk::Run::getErrorCode () const
|
||||
@ -1338,14 +1338,15 @@ int Awk::run (const char_t* main, const char_t** args, size_t nargs)
|
||||
runios.console = consoleHandler;
|
||||
runios.custom_data = this;
|
||||
|
||||
ase_memset (&runcbs, 0, ASE_SIZEOF(runcbs));
|
||||
runcbs.on_start = onRunStart;
|
||||
if (runCallback)
|
||||
{
|
||||
runcbs.on_start = onRunStart;
|
||||
runcbs.on_end = onRunEnd;
|
||||
runcbs.on_return = onRunReturn;
|
||||
runcbs.on_statement = onRunStatement;
|
||||
runcbs.custom_data = &runctx;
|
||||
}
|
||||
runcbs.custom_data = &runctx;
|
||||
|
||||
if (nargs > 0)
|
||||
{
|
||||
@ -1375,10 +1376,7 @@ int Awk::run (const char_t* main, const char_t** args, size_t nargs)
|
||||
runarg[i].len = 0;
|
||||
}
|
||||
|
||||
int n = ase_awk_run (
|
||||
awk, main, &runios,
|
||||
(runCallback? &runcbs: ASE_NULL),
|
||||
runarg, &runctx);
|
||||
int n = ase_awk_run (awk, main, &runios, &runcbs, runarg, &runctx);
|
||||
if (n == -1) retrieveError ();
|
||||
|
||||
if (runarg != ASE_NULL)
|
||||
@ -1537,6 +1535,11 @@ void Awk::disableRunCallback ()
|
||||
runCallback = false;
|
||||
}
|
||||
|
||||
void Awk::triggerOnRunStart (Run& run)
|
||||
{
|
||||
if (runCallback) onRunStart (run);
|
||||
}
|
||||
|
||||
void Awk::onRunStart (Run& run)
|
||||
{
|
||||
}
|
||||
@ -1711,7 +1714,7 @@ void Awk::onRunStart (run_t* run, void* custom)
|
||||
r->run = run;
|
||||
|
||||
r->callbackFailed = false;
|
||||
r->awk->onRunStart (*r);
|
||||
r->awk->triggerOnRunStart (*r);
|
||||
}
|
||||
|
||||
void Awk::onRunEnd (run_t* run, int errnum, void* custom)
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: Awk.hpp,v 1.74 2007/10/13 06:28:17 bacon Exp $
|
||||
* $Id: Awk.hpp,v 1.76 2007/10/14 16:34:57 bacon Exp $
|
||||
*
|
||||
* {License}
|
||||
*/
|
||||
@ -279,6 +279,12 @@ public:
|
||||
};
|
||||
|
||||
class Run;
|
||||
class Argument;
|
||||
class Return;
|
||||
|
||||
friend class Run;
|
||||
friend class Argument;
|
||||
friend class Return;
|
||||
|
||||
/**
|
||||
* Represents an argument to an intrinsic function
|
||||
@ -287,7 +293,7 @@ public:
|
||||
{
|
||||
public:
|
||||
friend class Awk;
|
||||
friend class Awk::Run;
|
||||
friend class Run;
|
||||
|
||||
Argument (Run& run);
|
||||
Argument (Run* run);
|
||||
@ -331,8 +337,8 @@ public:
|
||||
int getIndexed (const char_t* idxptr, size_t idxlen, Argument& val) const;
|
||||
int getIndexed (long_t idx, Argument& val) const;
|
||||
|
||||
int getFirstIndex (Awk::Argument& val) const;
|
||||
int getNextIndex (Awk::Argument& val) const;
|
||||
int getFirstIndex (Argument& val) const;
|
||||
int getNextIndex (Argument& val) const;
|
||||
|
||||
protected:
|
||||
Run* run;
|
||||
@ -354,7 +360,7 @@ public:
|
||||
{
|
||||
public:
|
||||
friend class Awk;
|
||||
friend class Awk::Run;
|
||||
friend class Run;
|
||||
|
||||
Return (Run& run);
|
||||
Return (Run* run);
|
||||
@ -564,8 +570,8 @@ public:
|
||||
{
|
||||
protected:
|
||||
friend class Awk;
|
||||
friend class Awk::Argument;
|
||||
friend class Awk::Return;
|
||||
friend class Argument;
|
||||
friend class Return;
|
||||
|
||||
Run (Awk* awk);
|
||||
Run (Awk* awk, run_t* run);
|
||||
@ -1066,6 +1072,8 @@ protected:
|
||||
private:
|
||||
Awk (const Awk&);
|
||||
Awk& operator= (const Awk&);
|
||||
|
||||
void triggerOnRunStart (Run& run);
|
||||
};
|
||||
|
||||
/////////////////////////////////
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: Awk.java,v 1.19 2007/10/14 05:28:26 bacon Exp $
|
||||
* $Id: Awk.java,v 1.20 2007/10/14 16:34:57 bacon Exp $
|
||||
*
|
||||
* {License}
|
||||
*/
|
||||
@ -121,7 +121,7 @@ public abstract class Awk
|
||||
run (null, null);
|
||||
}
|
||||
|
||||
/* == builtin functions == */
|
||||
/* == intrinsic functions == */
|
||||
public void addFunction (String name, int min_args, int max_args) throws Exception
|
||||
{
|
||||
addFunction (name, min_args, max_args, name);
|
||||
@ -151,6 +151,23 @@ public abstract class Awk
|
||||
functionTable.remove (name);
|
||||
}
|
||||
|
||||
protected Object handleFunction (
|
||||
long run, String name, Object args[]) throws java.lang.Exception
|
||||
{
|
||||
String mn = (String)functionTable.get(name);
|
||||
// name should always be found in this table.
|
||||
// otherwise, there is something wrong with this program.
|
||||
|
||||
Class c = this.getClass ();
|
||||
Class[] a = { Context.class, String.class, Object[].class };
|
||||
|
||||
// TODO: remove new Context ....
|
||||
Method m = c.getMethod (mn, a);
|
||||
return m.invoke (this,
|
||||
new Object[] { new Context(run), name, args}) ;
|
||||
}
|
||||
|
||||
|
||||
protected long builtinFunctionArgumentToLong (
|
||||
long runid, Object obj) throws Exception
|
||||
{
|
||||
@ -301,23 +318,6 @@ public abstract class Awk
|
||||
setword (null, null);
|
||||
}
|
||||
|
||||
/* == intrinsic function handling == */
|
||||
protected Object handleFunction (
|
||||
long run, String name, Object args[]) throws java.lang.Exception
|
||||
{
|
||||
String mn = (String)functionTable.get(name);
|
||||
// name should always be found in this table.
|
||||
// otherwise, there is something wrong with this program.
|
||||
|
||||
Class c = this.getClass ();
|
||||
Class[] a = { Context.class, String.class, Object[].class };
|
||||
|
||||
// TODO: remove new Context ....
|
||||
Method m = c.getMethod (mn, a);
|
||||
return m.invoke (this,
|
||||
new Object[] { new Context(run), name, args}) ;
|
||||
}
|
||||
|
||||
/* == source code management == */
|
||||
protected abstract int openSource (int mode);
|
||||
protected abstract int closeSource (int mode);
|
||||
@ -414,7 +414,6 @@ public abstract class Awk
|
||||
|
||||
switch (extio.getType())
|
||||
{
|
||||
|
||||
case Extio.TYPE_CONSOLE:
|
||||
{
|
||||
return writeConsole (
|
||||
@ -494,4 +493,11 @@ public abstract class Awk
|
||||
protected abstract int readPipe (Pipe pipe, char[] buf, int len);
|
||||
protected abstract int writePipe (Pipe pipe, char[] buf, int len);
|
||||
protected abstract int flushPipe (Pipe pipe);
|
||||
|
||||
/* TODO: ...
|
||||
protected void onRunStart (Context ctx) {}
|
||||
protected void onRunEnd (Context ctx) {}
|
||||
protected void onRunReturn (Context ctx) {}
|
||||
protected void onRunStatement (Context ctx) {}
|
||||
*/
|
||||
}
|
||||
|
@ -1,22 +1,22 @@
|
||||
/*
|
||||
* $Id: Context.java,v 1.2 2007/10/12 16:13:34 bacon Exp $
|
||||
* $Id: Context.java,v 1.3 2007/10/14 16:34:57 bacon Exp $
|
||||
*/
|
||||
|
||||
package ase.awk;
|
||||
|
||||
public class Context
|
||||
{
|
||||
private long run;
|
||||
private long handle;
|
||||
private Object custom;
|
||||
|
||||
Context (long run)
|
||||
Context (long handle)
|
||||
{
|
||||
this.run = run;
|
||||
this.handle = handle;
|
||||
}
|
||||
|
||||
public long getId ()
|
||||
{
|
||||
return this.run;
|
||||
return this.handle;
|
||||
}
|
||||
|
||||
public void setCustom (Object custom)
|
||||
|
25
ase/awk/jni-dmc.def
Normal file
25
ase/awk/jni-dmc.def
Normal file
@ -0,0 +1,25 @@
|
||||
LIBRARY "aseawk_jni.dll"
|
||||
EXETYPE NT
|
||||
|
||||
EXPORTS
|
||||
Java_ase_awk_Awk_open
|
||||
Java_ase_awk_Awk_close
|
||||
Java_ase_awk_Awk_parse
|
||||
Java_ase_awk_Awk_run
|
||||
Java_ase_awk_Awk_stop
|
||||
Java_ase_awk_Awk_getmaxdepth
|
||||
Java_ase_awk_Awk_setmaxdepth
|
||||
Java_ase_awk_Awk_getoption
|
||||
Java_ase_awk_Awk_setoption
|
||||
Java_ase_awk_Awk_getdebug
|
||||
Java_ase_awk_Awk_setdebug
|
||||
Java_ase_awk_Awk_addfunc
|
||||
Java_ase_awk_Awk_delfunc
|
||||
Java_ase_awk_Awk_setfilename
|
||||
Java_ase_awk_Awk_setofilename
|
||||
Java_ase_awk_Awk_strtonum
|
||||
Java_ase_awk_Awk_valtostr
|
||||
Java_ase_awk_Awk_strftime
|
||||
Java_ase_awk_Awk_strfgmtime
|
||||
Java_ase_awk_Awk_system
|
||||
|
134
ase/awk/jni.c
134
ase/awk/jni.c
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: jni.c,v 1.22 2007/10/14 05:28:26 bacon Exp $
|
||||
* $Id: jni.c,v 1.24 2007/10/14 16:34:57 bacon Exp $
|
||||
*
|
||||
* {License}
|
||||
*/
|
||||
@ -17,6 +17,7 @@
|
||||
#include <ase/awk/awk.h>
|
||||
#include <ase/awk/val.h>
|
||||
|
||||
#include <ase/cmn/mem.h>
|
||||
#include <ase/utl/stdio.h>
|
||||
#include <ase/utl/ctype.h>
|
||||
|
||||
@ -37,6 +38,7 @@
|
||||
#define CLASS_OUTOFMEMORYERROR "java/lang/OutOfMemoryError"
|
||||
#define CLASS_EXCEPTION "ase/awk/Exception"
|
||||
#define CLASS_EXTIO "ase/awk/Extio"
|
||||
#define CLASS_CONTEXT "ase/awk/Context"
|
||||
#define FIELD_HANDLE "handle"
|
||||
|
||||
#if defined(_WIN32) && defined(_MSC_VER) && (_MSC_VER>=1400)
|
||||
@ -114,7 +116,7 @@ struct run_data_t
|
||||
|
||||
static void* awk_malloc (void* custom, ase_size_t n)
|
||||
{
|
||||
#ifdef _WIN32
|
||||
#if defined(_WIN32) && defined(__DMC__)
|
||||
return HeapAlloc ((HANDLE)custom, 0, n);
|
||||
#else
|
||||
return malloc (n);
|
||||
@ -123,7 +125,7 @@ static void* awk_malloc (void* custom, ase_size_t n)
|
||||
|
||||
static void* awk_realloc (void* custom, void* ptr, ase_size_t n)
|
||||
{
|
||||
#ifdef _WIN32
|
||||
#if defined(_WIN32) && defined(__DMC__)
|
||||
if (ptr == NULL)
|
||||
return HeapAlloc ((HANDLE)custom, 0, n);
|
||||
else
|
||||
@ -135,7 +137,7 @@ static void* awk_realloc (void* custom, void* ptr, ase_size_t n)
|
||||
|
||||
static void awk_free (void* custom, void* ptr)
|
||||
{
|
||||
#ifdef _WIN32
|
||||
#if defined(_WIN32) && defined(__DMC__)
|
||||
HeapFree ((HANDLE)custom, 0, ptr);
|
||||
#else
|
||||
free (ptr);
|
||||
@ -362,6 +364,7 @@ JNIEXPORT void JNICALL Java_ase_awk_Awk_open (JNIEnv* env, jobject obj)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(_WIN32) && defined(__DMC__)
|
||||
heap = HeapCreate (0, 0, 0);
|
||||
if (heap == NULL)
|
||||
{
|
||||
@ -371,6 +374,7 @@ JNIEXPORT void JNICALL Java_ase_awk_Awk_open (JNIEnv* env, jobject obj)
|
||||
ASE_AWK_ENOMEM,
|
||||
0);
|
||||
}
|
||||
#endif
|
||||
|
||||
memset (&prmfns, 0, sizeof(prmfns));
|
||||
|
||||
@ -607,12 +611,78 @@ static ase_char_t* java_strxdup (ase_awk_t* awk, const jchar* str, jint len)
|
||||
}
|
||||
}
|
||||
|
||||
#if 0
|
||||
static void xxx (JNIEnv* env, jobject obj, ase_awk_run_t* run)
|
||||
{
|
||||
jclass ctx_class;
|
||||
jmethodID ctx_cons;
|
||||
jobject ctx_object;
|
||||
|
||||
/* look for extio class */
|
||||
ctx_class = (*env)->FindClass (env, CLASS_CONTEXT);
|
||||
if (ctx_class == NULL)
|
||||
{
|
||||
if (is_debug(awk)) (*env)->ExceptionDescribe (env);
|
||||
(*env)->ExceptionClear (env);
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* get the constructor */
|
||||
ctx_cons = (*env)->GetMethodID (
|
||||
env, ctx_class, "<init>", "(J)V");
|
||||
if (ctx_cons == NULL)
|
||||
{
|
||||
if (is_debug(awk)) (*env)->ExceptionDescribe (env);
|
||||
(*env)->ExceptionClear (env);
|
||||
(*env)->DeleteLocalRef (env, extio_class);
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* construct the extio object */
|
||||
ctx_object = (*env)->NewObject (env, ctx_class, ctx_cons, (jlong)run)
|
||||
(*env)->DeleteLocalRef (env, ctx_class);
|
||||
if (ctx_object == NULL)
|
||||
{
|
||||
if (is_debug(awk)) (*env)->ExceptionDescribe (env);
|
||||
(*env)->ExceptionClear (env);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (ret >= 0)
|
||||
{
|
||||
/* ret == -1 failed to open the stream
|
||||
* ret == 0 opened the stream and reached its end
|
||||
* ret == 1 opened the stream. */
|
||||
extio->handle = (*env)->NewGlobalRef (env, extio_object);
|
||||
/*
|
||||
if (extio->handle == NULL)
|
||||
{
|
||||
// TODO: close the stream ...
|
||||
if (is_debug(awk)) (*env)->ExceptionDescribe (env);
|
||||
(*env)->ExceptionClear (env);
|
||||
ret = -1;
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
(*env)->DeleteLocalRef (env, extio_object);
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
|
||||
static void on_run_start (ase_awk_run_t* run, void* custom)
|
||||
{
|
||||
// TODO:
|
||||
//custom->context->setHandle (run);
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL Java_ase_awk_Awk_run (JNIEnv* env, jobject obj, jstring mfn, jobjectArray args)
|
||||
{
|
||||
jclass class;
|
||||
jfieldID handle;
|
||||
|
||||
ase_awk_t* awk;
|
||||
ase_awk_runcbs_t runcbs;
|
||||
ase_awk_runios_t runios;
|
||||
runio_data_t runio_data;
|
||||
run_data_t run_data;
|
||||
@ -704,6 +774,10 @@ JNIEXPORT void JNICALL Java_ase_awk_Awk_run (JNIEnv* env, jobject obj, jstring m
|
||||
runios.console = process_extio;
|
||||
runios.custom_data = &runio_data;
|
||||
|
||||
ase_memset (&runcbs, 0, ASE_SIZEOF(runcbs));
|
||||
runcbs.on_start = on_run_start;
|
||||
runcbs.custom_data = NULL;
|
||||
|
||||
if (mfn == NULL)
|
||||
{
|
||||
mmm = NULL;
|
||||
@ -853,8 +927,7 @@ JNIEXPORT void JNICALL Java_ase_awk_Awk_run (JNIEnv* env, jobject obj, jstring m
|
||||
runarg[i].len = 0;
|
||||
}
|
||||
|
||||
if (ase_awk_run (awk,
|
||||
mmm, &runios, ASE_NULL, runarg, &run_data) == -1)
|
||||
if (ase_awk_run (awk, mmm, &runios, &runcbs, runarg, &run_data) == -1)
|
||||
{
|
||||
if (runarg != NULL)
|
||||
{
|
||||
@ -906,7 +979,7 @@ JNIEXPORT void JNICALL Java_ase_awk_Awk_stop (JNIEnv* env, jobject obj)
|
||||
if (awk != NULL) ase_awk_stopall (awk);
|
||||
}
|
||||
|
||||
static ase_ssize_t __java_open_source (JNIEnv* env, jobject obj, int mode)
|
||||
static ase_ssize_t java_open_source (JNIEnv* env, jobject obj, int mode)
|
||||
{
|
||||
jclass class;
|
||||
jfieldID handle;
|
||||
@ -943,7 +1016,7 @@ static ase_ssize_t __java_open_source (JNIEnv* env, jobject obj, int mode)
|
||||
return ret;
|
||||
}
|
||||
|
||||
static ase_ssize_t __java_close_source (JNIEnv* env, jobject obj, int mode)
|
||||
static ase_ssize_t java_close_source (JNIEnv* env, jobject obj, int mode)
|
||||
{
|
||||
jclass class;
|
||||
jfieldID handle;
|
||||
@ -980,7 +1053,7 @@ static ase_ssize_t __java_close_source (JNIEnv* env, jobject obj, int mode)
|
||||
return ret;
|
||||
}
|
||||
|
||||
static ase_ssize_t __java_read_source (
|
||||
static ase_ssize_t java_read_source (
|
||||
JNIEnv* env, jobject obj, ase_char_t* buf, ase_size_t size)
|
||||
{
|
||||
jclass class;
|
||||
@ -1033,7 +1106,7 @@ static ase_ssize_t __java_read_source (
|
||||
return i;
|
||||
}
|
||||
|
||||
static ase_ssize_t __java_write_source (
|
||||
static ase_ssize_t java_write_source (
|
||||
JNIEnv* env, jobject obj, ase_char_t* buf, ase_size_t size)
|
||||
{
|
||||
jclass class;
|
||||
@ -1087,7 +1160,7 @@ static ase_ssize_t __java_write_source (
|
||||
return ret;
|
||||
}
|
||||
|
||||
static ase_ssize_t __java_open_extio (
|
||||
static ase_ssize_t java_open_extio (
|
||||
JNIEnv* env, jobject obj, char* meth, ase_awk_extio_t* extio)
|
||||
{
|
||||
jclass class;
|
||||
@ -1216,7 +1289,7 @@ static ase_ssize_t __java_open_extio (
|
||||
return ret;
|
||||
}
|
||||
|
||||
static ase_ssize_t __java_close_extio (
|
||||
static ase_ssize_t java_close_extio (
|
||||
JNIEnv* env, jobject obj, char* meth, ase_awk_extio_t* extio)
|
||||
{
|
||||
jclass class;
|
||||
@ -1262,7 +1335,7 @@ static ase_ssize_t __java_close_extio (
|
||||
return ret;
|
||||
}
|
||||
|
||||
static ase_ssize_t __java_read_extio (
|
||||
static ase_ssize_t java_read_extio (
|
||||
JNIEnv* env, jobject obj, char* meth,
|
||||
ase_awk_extio_t* extio, ase_char_t* buf, ase_size_t size)
|
||||
{
|
||||
@ -1320,7 +1393,7 @@ static ase_ssize_t __java_read_extio (
|
||||
return ret;
|
||||
}
|
||||
|
||||
static ase_ssize_t __java_write_extio (
|
||||
static ase_ssize_t java_write_extio (
|
||||
JNIEnv* env, jobject obj, char* meth,
|
||||
ase_awk_extio_t* extio, ase_char_t* data, ase_size_t size)
|
||||
{
|
||||
@ -1376,7 +1449,7 @@ static ase_ssize_t __java_write_extio (
|
||||
}
|
||||
|
||||
|
||||
static ase_ssize_t __java_flush_extio (
|
||||
static ase_ssize_t java_flush_extio (
|
||||
JNIEnv* env, jobject obj, char* meth, ase_awk_extio_t* extio)
|
||||
{
|
||||
jclass class;
|
||||
@ -1413,7 +1486,7 @@ static ase_ssize_t __java_flush_extio (
|
||||
return ret;
|
||||
}
|
||||
|
||||
static ase_ssize_t __java_next_extio (
|
||||
static ase_ssize_t java_next_extio (
|
||||
JNIEnv* env, jobject obj, char* meth, ase_awk_extio_t* extio)
|
||||
{
|
||||
jclass class;
|
||||
@ -1456,17 +1529,17 @@ static ase_ssize_t read_source (
|
||||
|
||||
if (cmd == ASE_AWK_IO_OPEN)
|
||||
{
|
||||
return __java_open_source (
|
||||
return java_open_source (
|
||||
srcio_data->env, srcio_data->obj, SOURCE_READ);
|
||||
}
|
||||
else if (cmd == ASE_AWK_IO_CLOSE)
|
||||
{
|
||||
return __java_close_source (
|
||||
return java_close_source (
|
||||
srcio_data->env, srcio_data->obj, SOURCE_READ);
|
||||
}
|
||||
else if (cmd == ASE_AWK_IO_READ)
|
||||
{
|
||||
return __java_read_source (
|
||||
return java_read_source (
|
||||
srcio_data->env, srcio_data->obj, data, count);
|
||||
}
|
||||
|
||||
@ -1480,17 +1553,17 @@ static ase_ssize_t write_source (
|
||||
|
||||
if (cmd == ASE_AWK_IO_OPEN)
|
||||
{
|
||||
return __java_open_source (
|
||||
return java_open_source (
|
||||
srcio_data->env, srcio_data->obj, SOURCE_WRITE);
|
||||
}
|
||||
else if (cmd == ASE_AWK_IO_CLOSE)
|
||||
{
|
||||
return __java_close_source (
|
||||
return java_close_source (
|
||||
srcio_data->env, srcio_data->obj, SOURCE_WRITE);
|
||||
}
|
||||
else if (cmd == ASE_AWK_IO_WRITE)
|
||||
{
|
||||
return __java_write_source (
|
||||
return java_write_source (
|
||||
srcio_data->env, srcio_data->obj, data, count);
|
||||
}
|
||||
|
||||
@ -1507,33 +1580,33 @@ static ase_ssize_t process_extio (
|
||||
{
|
||||
|
||||
case ASE_AWK_IO_OPEN:
|
||||
return __java_open_extio (
|
||||
return java_open_extio (
|
||||
runio_data->env, runio_data->obj,
|
||||
"openExtio", epa);
|
||||
|
||||
case ASE_AWK_IO_CLOSE:
|
||||
return __java_close_extio (
|
||||
return java_close_extio (
|
||||
runio_data->env, runio_data->obj,
|
||||
"closeExtio", epa);
|
||||
|
||||
case ASE_AWK_IO_READ:
|
||||
return __java_read_extio (
|
||||
return java_read_extio (
|
||||
runio_data->env, runio_data->obj,
|
||||
"readExtio", epa, data, size);
|
||||
|
||||
case ASE_AWK_IO_WRITE:
|
||||
|
||||
return __java_write_extio (
|
||||
return java_write_extio (
|
||||
runio_data->env, runio_data->obj,
|
||||
"writeExtio", epa, data, size);
|
||||
|
||||
case ASE_AWK_IO_FLUSH:
|
||||
return __java_flush_extio (
|
||||
return java_flush_extio (
|
||||
runio_data->env, runio_data->obj,
|
||||
"flushExtio", epa);
|
||||
|
||||
case ASE_AWK_IO_NEXT:
|
||||
return __java_next_extio (
|
||||
return java_next_extio (
|
||||
runio_data->env, runio_data->obj,
|
||||
"nextExtio", epa);
|
||||
|
||||
@ -1548,7 +1621,7 @@ static int handle_bfn (
|
||||
jclass class;
|
||||
jmethodID method;
|
||||
jstring name;
|
||||
const char* name_utf;
|
||||
//const char* name_utf;
|
||||
run_data_t* run_data;
|
||||
JNIEnv* env;
|
||||
jobject obj;
|
||||
@ -1568,7 +1641,8 @@ static int handle_bfn (
|
||||
if (fnl > 0 && ASE_SIZEOF(jchar) != ASE_SIZEOF(ase_char_t))
|
||||
{
|
||||
ase_size_t i;
|
||||
jchar* tmp = (jchar*) ase_awk_awk (awk, ASE_SIZEOF(jchar)*(fnl+4));
|
||||
jchar* tmp = (jchar*) ase_awk_malloc (
|
||||
awk, ASE_SIZEOF(jchar)*(fnl+4));
|
||||
if (tmp == NULL)
|
||||
{
|
||||
ase_awk_setrunerrnum (run, ASE_AWK_ENOMEM);
|
||||
|
@ -1,5 +1,4 @@
|
||||
LIBRARY "aseawk_jni.dll"
|
||||
EXETYPE NT
|
||||
|
||||
EXPORTS
|
||||
Java_ase_awk_Awk_open
|
||||
|
@ -1,54 +0,0 @@
|
||||
OUT = aseawk
|
||||
|
||||
C_SRCS = awk.c err.c tree.c tab.c map.c parse.c \
|
||||
run.c rec.c val.c func.c misc.c extio.c rex.c
|
||||
JNI_SRCS = jni.c
|
||||
JAVA_SRCS = Exception.java Extio.java Awk.java StdAwk.java
|
||||
|
||||
C_OBJS = $(C_SRCS:.c=.obj)
|
||||
JNI_OBJS = $(JNI_SRCS:.c=.obj)
|
||||
JAVA_OBJS = $(JAVA_SRCS:.java=.class)
|
||||
|
||||
JNI_INCPATH = \
|
||||
-I"$(JAVA_HOME)/include" \
|
||||
-I"$(JAVA_HOME)/include/win32"
|
||||
|
||||
CC = bcc32
|
||||
LD = ilink32
|
||||
AR = tlib
|
||||
JAVAC = javac
|
||||
|
||||
CFLAGS_COMMON = -O2 -WM -WU -RT- -w -q -I../.. $(JNI_INCPATH)
|
||||
CFLAGS_RELEASE = $(CFLAGS_COMMON) -DNDEBUG
|
||||
CFLAGS_DEBUG = $(CFLAGS_COMMON) -D_DEBUG #-DDEBUG_REX
|
||||
CFLAGS = $(CFLAGS_DEBUG)
|
||||
#CFLAGS = $(CFLAGS_RELEASE)
|
||||
JAVACFLAGS = -classpath ../..
|
||||
|
||||
LDFLAGS = -Tpd -ap -Gn -c -q
|
||||
STARTUP = c0d32w.obj
|
||||
LIBS = import32.lib cw32mt.lib
|
||||
|
||||
JNI_LDFLAGS = $(LDFLAGS) -L..\cmn -L..\utl
|
||||
JNI_LIBS = $(LIBS) $(OUT).lib asecmn.lib aseutl.lib
|
||||
|
||||
all: lib
|
||||
|
||||
lib: $(C_OBJS)
|
||||
$(AR) $(OUT).lib @&&!
|
||||
+-$(**: = &^
|
||||
+-)
|
||||
!
|
||||
|
||||
jni: lib $(JNI_OBJS) $(JAVA_OBJS)
|
||||
$(LD) $(JNI_LDFLAGS) $(STARTUP) $(JNI_OBJS),$(OUT)_jni.dll,,$(JNI_LIBS),jni.def,
|
||||
|
||||
clean:
|
||||
-del $(OBJS) $(OUT).lib $(OUT)_jni.dll *.obj *.class
|
||||
|
||||
.SUFFIXES: .c .obj .java .class
|
||||
.c.obj:
|
||||
$(CC) $(CFLAGS) -c $<
|
||||
|
||||
.java.class:
|
||||
$(JAVAC) $(JAVACFLAGS) $<
|
@ -1,45 +0,0 @@
|
||||
OUT = aseawk
|
||||
|
||||
C_SRCS = awk.c err.c tree.c tab.c map.c parse.c \
|
||||
run.c rec.c val.c func.c misc.c extio.c rex.c
|
||||
JNI_SRCS = jni.c
|
||||
JAVA_SRCS = Exception.java Extio.java Awk.java StdAwk.java
|
||||
|
||||
C_OBJS = $(C_SRCS:.c=.obj)
|
||||
JNI_OBJS = $(JNI_SRCS:.c=.obj)
|
||||
JAVA_OBJS = $(JAVA_SRCS:.java=.class)
|
||||
|
||||
JNI_INC = \
|
||||
/I"$(JAVA_HOME)/include" \
|
||||
/I"$(JAVA_HOME)/include\win32"
|
||||
|
||||
CC = cl
|
||||
LD = link
|
||||
JAVAC = javac
|
||||
|
||||
#CFLAGS = /nologo /O2 /MT /W3 /GR- /GS- /Za -I../.. $(JNI_INC)
|
||||
CFLAGS = /nologo /O2 /MT /W3 /GR- /GS- -I../.. $(JNI_INC)
|
||||
JAVACFLAGS = -classpath ../.. -Xlint:unchecked
|
||||
|
||||
all: lib
|
||||
|
||||
lib: $(C_OBJS)
|
||||
$(LD) /lib @<<
|
||||
/nologo /out:$(OUT).lib $(C_OBJS)
|
||||
<<
|
||||
|
||||
jni: lib $(JNI_OBJS) $(JAVA_OBJS)
|
||||
$(LD) /dll /def:jni.def /subsystem:windows /version:0.1 /release @<<
|
||||
/nologo /out:$(OUT)_jni.dll $(JNI_OBJS) /libpath:../cmn /libpath:../utl /implib:tmp.lib user32.lib $(OUT).lib asecmn.lib aseutl.lib
|
||||
<<
|
||||
del tmp.lib tmp.exp
|
||||
|
||||
clean:
|
||||
del $(OBJS) $(OUT).lib $(OUT)_jni.dll *.obj *.class
|
||||
|
||||
.SUFFIXES: .c .obj .java .class
|
||||
.c.obj:
|
||||
$(CC) $(CFLAGS) /c $<
|
||||
|
||||
.java.class:
|
||||
$(JAVAC) $(JAVACFLAGS) $<
|
185
ase/awk/msw-bcc.mak
Normal file
185
ase/awk/msw-bcc.mak
Normal file
@ -0,0 +1,185 @@
|
||||
NAME = aseawk
|
||||
|
||||
!ifndef MODE
|
||||
MODE = release
|
||||
!endif
|
||||
|
||||
JNI_INC = \
|
||||
-I"$(JAVA_HOME)\include" \
|
||||
-I"$(JAVA_HOME)\include\win32"
|
||||
|
||||
CC = bcc32
|
||||
CXX = bcc32
|
||||
LD = ilink32
|
||||
AR = tlib
|
||||
JAVAC = javac
|
||||
JAR = jar
|
||||
|
||||
CFLAGS = -O2 -WM -WU -RT- -w -q -I..\..
|
||||
CXXFLAGS = -O2 -WM -WU -RT- -w -q -I..\..
|
||||
JAVACFLAGS = -classpath ..\.. -Xlint:unchecked
|
||||
|
||||
LDFLAGS = -Tpd -ap -Gn -c -q -L..\$(MODE)\lib
|
||||
STARTUP = c0d32w.obj
|
||||
LIBS = import32.lib cw32mt.lib asecmn.lib aseutl.lib $(NAME).lib
|
||||
|
||||
OUT_DIR = ..\$(MODE)\lib
|
||||
OUT_FILE_LIB = $(OUT_DIR)\$(NAME).lib
|
||||
OUT_FILE_JNI = $(OUT_DIR)\$(NAME)_jni.dll
|
||||
OUT_FILE_LIB_CXX = $(OUT_DIR)\$(NAME)++.lib
|
||||
OUT_FILE_JAR = $(OUT_DIR)\$(NAME).jar
|
||||
|
||||
TMP_DIR = $(MODE)
|
||||
TMP_DIR_CXX = $(TMP_DIR)\cxx
|
||||
|
||||
OBJ_FILES_LIB = \
|
||||
$(TMP_DIR)\awk.obj \
|
||||
$(TMP_DIR)\err.obj \
|
||||
$(TMP_DIR)\tree.obj \
|
||||
$(TMP_DIR)\tab.obj \
|
||||
$(TMP_DIR)\map.obj \
|
||||
$(TMP_DIR)\parse.obj \
|
||||
$(TMP_DIR)\run.obj \
|
||||
$(TMP_DIR)\rec.obj \
|
||||
$(TMP_DIR)\val.obj \
|
||||
$(TMP_DIR)\func.obj \
|
||||
$(TMP_DIR)\misc.obj \
|
||||
$(TMP_DIR)\extio.obj \
|
||||
$(TMP_DIR)\rex.obj
|
||||
|
||||
OBJ_FILES_JNI = $(TMP_DIR)\jni.obj
|
||||
|
||||
OBJ_FILES_LIB_CXX = \
|
||||
$(TMP_DIR)\cxx\Awk.obj \
|
||||
$(TMP_DIR)\cxx\StdAwk.obj
|
||||
|
||||
OBJ_FILES_JAR = \
|
||||
$(TMP_DIR)\ase\awk\Awk.class \
|
||||
$(TMP_DIR)\ase\awk\StdAwk.class \
|
||||
$(TMP_DIR)\ase\awk\Context.class \
|
||||
$(TMP_DIR)\ase\awk\Extio.class \
|
||||
$(TMP_DIR)\ase\awk\IO.class \
|
||||
$(TMP_DIR)\ase\awk\Console.class \
|
||||
$(TMP_DIR)\ase\awk\File.class \
|
||||
$(TMP_DIR)\ase\awk\Pipe.class \
|
||||
$(TMP_DIR)\ase\awk\Exception.class
|
||||
|
||||
all: lib
|
||||
|
||||
lib: $(TMP_DIR) $(OUT_DIR) $(OUT_DIR_CXX) $(OUT_FILE_LIB) $(OUT_FILE_LIB_CXX)
|
||||
|
||||
jnidll: $(TMP_DIR) $(OUT_DIR) $(OUT_FILE_JNI)
|
||||
|
||||
jar: $(OUT_FILE_JAR)
|
||||
|
||||
$(OUT_FILE_LIB): $(OBJ_FILES_LIB)
|
||||
$(AR) $(OUT_FILE_LIB) @&&!
|
||||
+-$(**: = &^
|
||||
+-)
|
||||
!
|
||||
|
||||
$(OUT_FILE_LIB_CXX): $(OBJ_FILES_LIB_CXX)
|
||||
$(AR) "$(OUT_FILE_LIB_CXX)" @&&!
|
||||
+-$(**: = &^
|
||||
+-)
|
||||
!
|
||||
|
||||
$(OUT_FILE_JNI): $(OUT_FILE_LIB) $(OBJ_FILES_JNI)
|
||||
$(LD) $(LDFLAGS) $(STARTUP) $(OBJ_FILES_JNI),$(OUT_FILE_JNI),,$(LIBS),jni.def,
|
||||
|
||||
$(OUT_FILE_JAR): $(OBJ_FILES_JAR)
|
||||
$(JAR) -Mcvf $(OUT_FILE_JAR) -C $(TMP_DIR) ase
|
||||
|
||||
$(TMP_DIR)\awk.obj: awk.c
|
||||
$(CC) $(CFLAGS) -o$@ -c awk.c
|
||||
|
||||
$(TMP_DIR)\err.obj: err.c
|
||||
$(CC) $(CFLAGS) -o$@ -c err.c
|
||||
|
||||
$(TMP_DIR)\tree.obj: tree.c
|
||||
$(CC) $(CFLAGS) -o$@ -c tree.c
|
||||
|
||||
$(TMP_DIR)\tab.obj: tab.c
|
||||
$(CC) $(CFLAGS) -o$@ -c tab.c
|
||||
|
||||
$(TMP_DIR)\map.obj: map.c
|
||||
$(CC) $(CFLAGS) -o$@ -c map.c
|
||||
|
||||
$(TMP_DIR)\parse.obj: parse.c
|
||||
$(CC) $(CFLAGS) -o$@ -c parse.c
|
||||
|
||||
$(TMP_DIR)\run.obj: run.c
|
||||
$(CC) $(CFLAGS) -o$@ -c run.c
|
||||
|
||||
$(TMP_DIR)\rec.obj: rec.c
|
||||
$(CC) $(CFLAGS) -o$@ -c rec.c
|
||||
|
||||
$(TMP_DIR)\val.obj: val.c
|
||||
$(CC) $(CFLAGS) -o$@ -c val.c
|
||||
|
||||
$(TMP_DIR)\func.obj: func.c
|
||||
$(CC) $(CFLAGS) -o$@ -c func.c
|
||||
|
||||
$(TMP_DIR)\misc.obj: misc.c
|
||||
$(CC) $(CFLAGS) -o$@ -c misc.c
|
||||
|
||||
$(TMP_DIR)\extio.obj: extio.c
|
||||
$(CC) $(CFLAGS) -o$@ -c extio.c
|
||||
|
||||
$(TMP_DIR)\rex.obj: rex.c
|
||||
$(CC) $(CFLAGS) -o$@ -c rex.c
|
||||
|
||||
$(TMP_DIR)\jni.obj: jni.c
|
||||
$(CC) $(CFLAGS) $(JNI_INC) -o$@ -c jni.c
|
||||
|
||||
$(TMP_DIR)\cxx\Awk.obj: Awk.cpp Awk.hpp
|
||||
$(CXX) $(CXXFLAGS) -o$@ -c Awk.cpp
|
||||
|
||||
$(TMP_DIR)\cxx\StdAwk.obj: StdAwk.cpp StdAwk.hpp Awk.hpp
|
||||
$(CXX) $(CXXFLAGS) -o$@ -c StdAwk.cpp
|
||||
|
||||
$(TMP_DIR)\ase\awk\Awk.class: Awk.java
|
||||
$(JAVAC) $(JAVACFLAGS) -d $(TMP_DIR) Awk.java
|
||||
|
||||
$(TMP_DIR)\ase\awk\StdAwk.class: StdAwk.java
|
||||
$(JAVAC) $(JAVACFLAGS) -d $(TMP_DIR) StdAwk.java
|
||||
|
||||
$(TMP_DIR)\ase\awk\Context.class: Context.java
|
||||
$(JAVAC) $(JAVACFLAGS) -d $(TMP_DIR) Context.java
|
||||
|
||||
$(TMP_DIR)\ase\awk\Extio.class: Extio.java
|
||||
$(JAVAC) $(JAVACFLAGS) -d $(TMP_DIR) Extio.java
|
||||
|
||||
$(TMP_DIR)\ase\awk\IO.class: IO.java
|
||||
$(JAVAC) $(JAVACFLAGS) -d $(TMP_DIR) IO.java
|
||||
|
||||
$(TMP_DIR)\ase\awk\Console.class: Console.java
|
||||
$(JAVAC) $(JAVACFLAGS) -d $(TMP_DIR) Console.java
|
||||
|
||||
$(TMP_DIR)\ase\awk\File.class: File.java
|
||||
$(JAVAC) $(JAVACFLAGS) -d $(TMP_DIR) File.java
|
||||
|
||||
$(TMP_DIR)\ase\awk\Pipe.class: Pipe.java
|
||||
$(JAVAC) $(JAVACFLAGS) -d $(TMP_DIR) Pipe.java
|
||||
|
||||
$(TMP_DIR)\ase\awk\Exception.class: Exception.java
|
||||
$(JAVAC) $(JAVACFLAGS) -d $(TMP_DIR) Exception.java
|
||||
|
||||
$(OUT_DIR):
|
||||
-md $(OUT_DIR)
|
||||
|
||||
$(TMP_DIR):
|
||||
-md $(TMP_DIR)
|
||||
|
||||
$(TMP_DIR_CXX): $(TMP_DIR)
|
||||
-md $(TMP_DIR_CXX)
|
||||
|
||||
clean:
|
||||
-del $(OUT_FILE_LIB)
|
||||
-del $(OUT_FILE_JNI)
|
||||
-del $(OUT_FILE_JAR)
|
||||
-del $(OUT_FILE_LIB_CXX)
|
||||
-del $(OBJ_FILES_LIB)
|
||||
-del $(OBJ_FILES_JNI)
|
||||
-del $(OBJ_FILES_JAR)
|
||||
-del $(OBJ_FILES_LIB_CXX)
|
@ -1,27 +1,37 @@
|
||||
NAME = aseawk
|
||||
JNI =
|
||||
MODE = release
|
||||
|
||||
JNI_INC = \
|
||||
-I"$(JAVA_HOME)/include" \
|
||||
-I"$(JAVA_HOME)/include\win32"
|
||||
-I"$(JAVA_HOME)\include" \
|
||||
-I"$(JAVA_HOME)\include\win32"
|
||||
|
||||
CC = dmc
|
||||
CXX = dmc
|
||||
CC = cl
|
||||
CXX = cl
|
||||
LD = link
|
||||
AR = lib
|
||||
AR = link
|
||||
JAVAC = javac
|
||||
JAR = jar
|
||||
|
||||
CFLAGS = -mn -I..\.. $(JNI_INC)
|
||||
CXXFLAGS = -Aa -Ab -Ae -mn -I..\.. $(JNI_INC)
|
||||
CFLAGS = /nologo /W3 -I..\..
|
||||
CXXFLAGS = /nologo /W3 -I..\..
|
||||
JAVACFLAGS = -classpath ..\.. -Xlint:unchecked
|
||||
|
||||
MODE=debug
|
||||
!IF "$(MODE)" == "debug"
|
||||
CFLAGS = $(CFLAGS) -D_DEBUG -DDEBUG /MTd
|
||||
CXXFLAGS = $(CXXFLAGS) -D_DEBUG -DDEBUG /MTd
|
||||
!ELSEIF "$(MODE)" == "release"
|
||||
CFLAGS = $(CFLAGS) -DNDEBUG /MT /O2
|
||||
CXXFLAGS = $(CXXFLAGS) -DNDEBUG /MT /O2
|
||||
!ELSE
|
||||
CFLAGS = $(CFLAGS) /MT
|
||||
CXXFLAGS = $(CXXFLAGS) /MT
|
||||
!ENDIF
|
||||
|
||||
OUT_DIR = ..\$(MODE)\lib
|
||||
OUT_FILE_LIB = $(OUT_DIR)\$(NAME).lib
|
||||
OUT_FILE_JNI = $(OUT_DIR)\lib$(NAME)_jni.la
|
||||
OUT_FILE_LIB_CXX = $(OUT_DIR)\$(NAME)pp.lib
|
||||
OUT_FILE_JAR = $(OUT_DIR)/$(NAME).jar
|
||||
OUT_FILE_JNI = $(OUT_DIR)\$(NAME)_jni.dll
|
||||
OUT_FILE_LIB_CXX = $(OUT_DIR)\$(NAME)++.lib
|
||||
OUT_FILE_JAR = $(OUT_DIR)\$(NAME).jar
|
||||
|
||||
TMP_DIR = $(MODE)
|
||||
TMP_DIR_CXX = $(TMP_DIR)\cxx
|
||||
@ -48,108 +58,135 @@ OBJ_FILES_LIB_CXX = \
|
||||
$(TMP_DIR)\cxx\StdAwk.obj
|
||||
|
||||
OBJ_FILES_JAR = \
|
||||
$(TMP_DIR)/ase/awk/Awk.class \
|
||||
$(TMP_DIR)/ase/awk/StdAwk.class \
|
||||
$(TMP_DIR)/ase/awk/Extio.class \
|
||||
$(TMP_DIR)/ase/awk/IO.class \
|
||||
$(TMP_DIR)/ase/awk/Console.class \
|
||||
$(TMP_DIR)/ase/awk/File.class \
|
||||
$(TMP_DIR)/ase/awk/Pipe.class \
|
||||
$(TMP_DIR)/ase/awk/Exception.class
|
||||
$(TMP_DIR)\ase\awk\Awk.class \
|
||||
$(TMP_DIR)\ase\awk\StdAwk.class \
|
||||
$(TMP_DIR)\ase\awk\Context.class \
|
||||
$(TMP_DIR)\ase\awk\Extio.class \
|
||||
$(TMP_DIR)\ase\awk\IO.class \
|
||||
$(TMP_DIR)\ase\awk\Console.class \
|
||||
$(TMP_DIR)\ase\awk\File.class \
|
||||
$(TMP_DIR)\ase\awk\Pipe.class \
|
||||
$(TMP_DIR)\ase\awk\Exception.class
|
||||
|
||||
lib: build$(JNI)
|
||||
all: lib
|
||||
|
||||
build: $(OUT_FILE_LIB) $(OUT_FILE_LIB_CXX)
|
||||
lib: $(OUT_FILE_LIB) $(OUT_FILE_LIB_CXX)
|
||||
|
||||
buildjni: build $(OUT_FILE_JNI)
|
||||
jnidll: $(OUT_FILE_JNI)
|
||||
|
||||
jar: $(OUT_FILE_JAR)
|
||||
|
||||
$(OUT_FILE_LIB): $(TMP_DIR) $(OUT_DIR) $(OBJ_FILES_LIB)
|
||||
$(AR) -c $(OUT_FILE_LIB) $(OBJ_FILES_LIB)
|
||||
$(AR) /lib @<<
|
||||
/nologo /out:$(OUT_FILE_LIB) $(OBJ_FILES_LIB)
|
||||
<<
|
||||
|
||||
$(OUT_FILE_LIB_CXX): $(TMP_DIR_CXX) $(OUT_DIR) $(OUT_FILE_LIB) $(OBJ_FILES_LIB_CXX)
|
||||
$(AR) -c $(OUT_FILE_LIB_CXX) $(OBJ_FILES_LIB_CXX)
|
||||
$(OUT_FILE_LIB_CXX): $(TMP_DIR_CXX) $(OUT_FILE_LIB) $(OBJ_FILES_LIB_CXX)
|
||||
$(AR) /lib @<<
|
||||
/nologo /out:$(OUT_FILE_LIB_CXX) $(OBJ_FILES_LIB_CXX)
|
||||
<<
|
||||
|
||||
$(OUT_FILE_JNI): $(OUT_FILE_LIB) $(OBJ_FILES_JNI)
|
||||
$(LD) /dll /def:jni.def /subsystem:windows /release @<<
|
||||
/nologo /out:$(OUT_FILE_JNI) $(OBJ_FILES_JNI) /libpath:../$(MODE)/lib /implib:tmp.lib user32.lib $(OUT_FILE_LIB) asecmn.lib aseutl.lib
|
||||
<<
|
||||
del tmp.lib tmp.exp
|
||||
|
||||
|
||||
$(OUT_FILE_JAR): $(OBJ_FILES_JAR)
|
||||
$(JAR) -Mcvf $(OUT_FILE_JAR) -C $(TMP_DIR) ase
|
||||
|
||||
$(TMP_DIR)\awk.obj: awk.c
|
||||
$(CC) $(CFLAGS) -o$@ -c awk.c
|
||||
$(CC) $(CFLAGS) /Fo$@ /c awk.c
|
||||
|
||||
$(TMP_DIR)\err.obj: err.c
|
||||
$(CC) $(CFLAGS) -o$@ -c err.c
|
||||
$(CC) $(CFLAGS) /Fo$@ /c err.c
|
||||
|
||||
$(TMP_DIR)\tree.obj: tree.c
|
||||
$(CC) $(CFLAGS) -o$@ -c tree.c
|
||||
$(CC) $(CFLAGS) /Fo$@ /c tree.c
|
||||
|
||||
$(TMP_DIR)\tab.obj: tab.c
|
||||
$(CC) $(CFLAGS) -o$@ -c tab.c
|
||||
$(CC) $(CFLAGS) /Fo$@ /c tab.c
|
||||
|
||||
$(TMP_DIR)\map.obj: map.c
|
||||
$(CC) $(CFLAGS) -o$@ -c map.c
|
||||
$(CC) $(CFLAGS) /Fo$@ /c map.c
|
||||
|
||||
$(TMP_DIR)\parse.obj: parse.c
|
||||
$(CC) $(CFLAGS) -o$@ -c parse.c
|
||||
$(CC) $(CFLAGS) /Fo$@ /c parse.c
|
||||
|
||||
$(TMP_DIR)\run.obj: run.c
|
||||
$(CC) $(CFLAGS) -o$@ -c run.c
|
||||
$(CC) $(CFLAGS) /Fo$@ /c run.c
|
||||
|
||||
$(TMP_DIR)\rec.obj: rec.c
|
||||
$(CC) $(CFLAGS) -o$@ -c rec.c
|
||||
$(CC) $(CFLAGS) /Fo$@ /c rec.c
|
||||
|
||||
$(TMP_DIR)\val.obj: val.c
|
||||
$(CC) $(CFLAGS) -o$@ -c val.c
|
||||
$(CC) $(CFLAGS) /Fo$@ /c val.c
|
||||
|
||||
$(TMP_DIR)\func.obj: func.c
|
||||
$(CC) $(CFLAGS) -o$@ -c func.c
|
||||
$(CC) $(CFLAGS) /Fo$@ /c func.c
|
||||
|
||||
$(TMP_DIR)\misc.obj: misc.c
|
||||
$(CC) $(CFLAGS) -o$@ -c misc.c
|
||||
$(CC) $(CFLAGS) /Fo$@ /c misc.c
|
||||
|
||||
$(TMP_DIR)\extio.obj: extio.c
|
||||
$(CC) $(CFLAGS) -o$@ -c extio.c
|
||||
$(CC) $(CFLAGS) /Fo$@ /c extio.c
|
||||
|
||||
$(TMP_DIR)\rex.obj: rex.c
|
||||
$(CC) $(CFLAGS) -o$@ -c rex.c
|
||||
$(CC) $(CFLAGS) /Fo$@ /c rex.c
|
||||
|
||||
$(TMP_DIR)\jni.obj: jni.c
|
||||
$(CC) $(CFLAGS) $(CFLAGS_JNI) -o $@ -c jni.c
|
||||
$(CC) $(CFLAGS) $(JNI_INC) /Fo$@ /c jni.c
|
||||
|
||||
$(TMP_DIR)\cxx\Awk.obj: Awk.cpp Awk.hpp
|
||||
$(CXX) $(CXXFLAGS) -o $@ -c Awk.cpp
|
||||
$(CXX) $(CXXFLAGS) /Fo$@ /c Awk.cpp
|
||||
|
||||
$(TMP_DIR)\cxx\StdAwk.obj: StdAwk.cpp StdAwk.hpp Awk.hpp
|
||||
$(CXX) $(CXXFLAGS) -o $@ -c StdAwk.cpp
|
||||
$(CXX) $(CXXFLAGS) /Fo$@ /c StdAwk.cpp
|
||||
|
||||
$(TMP_DIR)/ase/awk/Awk.class: Awk.java
|
||||
$(JAVAC) -classpath ../.. -d $(TMP_DIR) Awk.java
|
||||
$(TMP_DIR)\ase\awk\Awk.class: Awk.java
|
||||
$(JAVAC) $(JAVACFLAGS) -d $(TMP_DIR) Awk.java
|
||||
|
||||
$(TMP_DIR)/ase/awk/StdAwk.class: StdAwk.java
|
||||
$(JAVAC) -classpath ../.. -d $(TMP_DIR) StdAwk.java
|
||||
$(TMP_DIR)\ase\awk\StdAwk.class: StdAwk.java
|
||||
$(JAVAC) $(JAVACFLAGS) -d $(TMP_DIR) StdAwk.java
|
||||
|
||||
$(TMP_DIR)/ase/awk/Extio.class: Extio.java
|
||||
$(JAVAC) -classpath ../.. -d $(TMP_DIR) Extio.java
|
||||
$(TMP_DIR)\ase\awk\Context.class: Context.java
|
||||
$(JAVAC) $(JAVACFLAGS) -d $(TMP_DIR) Context.java
|
||||
|
||||
$(TMP_DIR)/ase/awk/IO.class: IO.java
|
||||
$(JAVAC) -classpath ../.. -d $(TMP_DIR) IO.java
|
||||
$(TMP_DIR)\ase\awk\Extio.class: Extio.java
|
||||
$(JAVAC) $(JAVACFLAGS) -d $(TMP_DIR) Extio.java
|
||||
|
||||
$(TMP_DIR)/ase/awk/Console.class: Console.java
|
||||
$(JAVAC) -classpath ../.. -d $(TMP_DIR) Console.java
|
||||
$(TMP_DIR)\ase\awk\IO.class: IO.java
|
||||
$(JAVAC) $(JAVACFLAGS) -d $(TMP_DIR) IO.java
|
||||
|
||||
$(TMP_DIR)/ase/awk/File.class: File.java
|
||||
$(JAVAC) -classpath ../.. -d $(TMP_DIR) File.java
|
||||
$(TMP_DIR)\ase\awk\Console.class: Console.java
|
||||
$(JAVAC) $(JAVACFLAGS) -d $(TMP_DIR) Console.java
|
||||
|
||||
$(TMP_DIR)/ase/awk/Pipe.class: Pipe.java
|
||||
$(JAVAC) -classpath ../.. -d $(TMP_DIR) Pipe.java
|
||||
$(TMP_DIR)\ase\awk\File.class: File.java
|
||||
$(JAVAC) $(JAVACFLAGS) -d $(TMP_DIR) File.java
|
||||
|
||||
$(TMP_DIR)/ase/awk/Exception.class: Exception.java
|
||||
$(JAVAC) -classpath ../.. -d $(TMP_DIR) Exception.java
|
||||
$(TMP_DIR)\ase\awk\Pipe.class: Pipe.java
|
||||
$(JAVAC) $(JAVACFLAGS) -d $(TMP_DIR) Pipe.java
|
||||
|
||||
$(TMP_DIR)\ase\awk\Exception.class: Exception.java
|
||||
$(JAVAC) $(JAVACFLAGS) -d $(TMP_DIR) Exception.java
|
||||
|
||||
$(OUT_DIR):
|
||||
md $(OUT_DIR)
|
||||
-md $(OUT_DIR)
|
||||
|
||||
$(TMP_DIR):
|
||||
md $(TMP_DIR)
|
||||
-md $(TMP_DIR)
|
||||
|
||||
$(TMP_DIR_CXX): $(TMP_DIR)
|
||||
md $(TMP_DIR_CXX)
|
||||
-md $(TMP_DIR_CXX)
|
||||
|
||||
clean:
|
||||
rm -rf $(OUT_FILE_LIB) $(OUT_FILE_JNI) $(OUT_FILE_JAR) $(OUT_FILE_LIB_CXX) $(OBJ_FILES_LIB) $(OBJ_FILES_JNI) $(OBJ_FILES_JAR) $(OBJ_FILES_LIB_CXX)
|
||||
-del $(OUT_FILE_LIB)
|
||||
-del $(OUT_FILE_JNI)
|
||||
-del $(OUT_FILE_JAR)
|
||||
-del $(OUT_FILE_LIB_CXX)
|
||||
-del $(OBJ_FILES_LIB)
|
||||
-del $(OBJ_FILES_JNI)
|
||||
-del $(OBJ_FILES_JAR)
|
||||
-del $(OBJ_FILES_LIB_CXX)
|
||||
|
||||
|
151
ase/awk/msw-dmc.mak
Normal file
151
ase/awk/msw-dmc.mak
Normal file
@ -0,0 +1,151 @@
|
||||
NAME = aseawk
|
||||
MODE = release
|
||||
|
||||
JNI_INC = \
|
||||
-I"$(JAVA_HOME)\include" \
|
||||
-I"$(JAVA_HOME)\include\win32"
|
||||
|
||||
CC = dmc
|
||||
LD = dmc
|
||||
AR = lib
|
||||
JAVAC = javac
|
||||
JAR = jar
|
||||
|
||||
CFLAGS = -mn -I..\.. -DUNICODE -D_UNICODE #-D_DEBUG
|
||||
JAVACFLAGS = -classpath ..\.. -Xlint:unchecked
|
||||
|
||||
OUT_DIR = ..\$(MODE)\lib
|
||||
OUT_FILE_LIB = $(OUT_DIR)\$(NAME).lib
|
||||
OUT_FILE_JNI = $(OUT_DIR)\$(NAME)_jni.dll
|
||||
OUT_FILE_JAR = $(OUT_DIR)\$(NAME).jar
|
||||
|
||||
TMP_DIR = $(MODE)
|
||||
|
||||
OBJ_FILES_LIB = \
|
||||
$(TMP_DIR)\awk.obj \
|
||||
$(TMP_DIR)\err.obj \
|
||||
$(TMP_DIR)\tree.obj \
|
||||
$(TMP_DIR)\tab.obj \
|
||||
$(TMP_DIR)\map.obj \
|
||||
$(TMP_DIR)\parse.obj \
|
||||
$(TMP_DIR)\run.obj \
|
||||
$(TMP_DIR)\rec.obj \
|
||||
$(TMP_DIR)\val.obj \
|
||||
$(TMP_DIR)\func.obj \
|
||||
$(TMP_DIR)\misc.obj \
|
||||
$(TMP_DIR)\extio.obj \
|
||||
$(TMP_DIR)\rex.obj
|
||||
|
||||
OBJ_FILES_JNI = $(TMP_DIR)\jni.obj
|
||||
|
||||
OBJ_FILES_JAR = \
|
||||
$(TMP_DIR)\ase\awk\Awk.class \
|
||||
$(TMP_DIR)\ase\awk\StdAwk.class \
|
||||
$(TMP_DIR)\ase\awk\Context.class \
|
||||
$(TMP_DIR)\ase\awk\Extio.class \
|
||||
$(TMP_DIR)\ase\awk\IO.class \
|
||||
$(TMP_DIR)\ase\awk\Console.class \
|
||||
$(TMP_DIR)\ase\awk\File.class \
|
||||
$(TMP_DIR)\ase\awk\Pipe.class \
|
||||
$(TMP_DIR)\ase\awk\Exception.class
|
||||
|
||||
all: lib
|
||||
|
||||
lib: $(OUT_FILE_LIB)
|
||||
|
||||
jnidll: $(OUT_FILE_JNI)
|
||||
|
||||
jar: $(OUT_FILE_JAR)
|
||||
|
||||
$(OUT_FILE_LIB): $(TMP_DIR) $(OUT_DIR) $(OBJ_FILES_LIB)
|
||||
$(AR) -c $(OUT_FILE_LIB) $(OBJ_FILES_LIB)
|
||||
|
||||
$(OUT_FILE_JNI): $(OUT_FILE_LIB) $(OBJ_FILES_JNI)
|
||||
$(LD) -WD -o$(OUT_FILE_JNI) $(OBJ_FILES_JNI) $(OUT_FILE_LIB) $(OUT_DIR)\asecmn.lib $(OUT_DIR)\aseutl.lib kernel32.lib jni-dmc.def
|
||||
|
||||
$(OUT_FILE_JAR): $(OBJ_FILES_JAR)
|
||||
$(JAR) -Mcvf $(OUT_FILE_JAR) -C $(TMP_DIR) ase
|
||||
|
||||
$(TMP_DIR)\awk.obj: awk.c
|
||||
$(CC) $(CFLAGS) -o$@ -c awk.c
|
||||
|
||||
$(TMP_DIR)\err.obj: err.c
|
||||
$(CC) $(CFLAGS) -o$@ -c err.c
|
||||
|
||||
$(TMP_DIR)\tree.obj: tree.c
|
||||
$(CC) $(CFLAGS) -o$@ -c tree.c
|
||||
|
||||
$(TMP_DIR)\tab.obj: tab.c
|
||||
$(CC) $(CFLAGS) -o$@ -c tab.c
|
||||
|
||||
$(TMP_DIR)\map.obj: map.c
|
||||
$(CC) $(CFLAGS) -o$@ -c map.c
|
||||
|
||||
$(TMP_DIR)\parse.obj: parse.c
|
||||
$(CC) $(CFLAGS) -o$@ -c parse.c
|
||||
|
||||
$(TMP_DIR)\run.obj: run.c
|
||||
$(CC) $(CFLAGS) -o$@ -c run.c
|
||||
|
||||
$(TMP_DIR)\rec.obj: rec.c
|
||||
$(CC) $(CFLAGS) -o$@ -c rec.c
|
||||
|
||||
$(TMP_DIR)\val.obj: val.c
|
||||
$(CC) $(CFLAGS) -o$@ -c val.c
|
||||
|
||||
$(TMP_DIR)\func.obj: func.c
|
||||
$(CC) $(CFLAGS) -o$@ -c func.c
|
||||
|
||||
$(TMP_DIR)\misc.obj: misc.c
|
||||
$(CC) $(CFLAGS) -o$@ -c misc.c
|
||||
|
||||
$(TMP_DIR)\extio.obj: extio.c
|
||||
$(CC) $(CFLAGS) -o$@ -c extio.c
|
||||
|
||||
$(TMP_DIR)\rex.obj: rex.c
|
||||
$(CC) $(CFLAGS) -o$@ -c rex.c
|
||||
|
||||
$(TMP_DIR)\jni.obj: jni.c
|
||||
$(CC) $(CFLAGS) $(JNI_INC) -o$@ -c jni.c
|
||||
|
||||
$(TMP_DIR)\ase\awk\Awk.class: Awk.java
|
||||
$(JAVAC) $(JAVACFLAGS) -d $(TMP_DIR) Awk.java
|
||||
|
||||
$(TMP_DIR)\ase\awk\StdAwk.class: StdAwk.java
|
||||
$(JAVAC) $(JAVACFLAGS) -d $(TMP_DIR) StdAwk.java
|
||||
|
||||
$(TMP_DIR)\ase\awk\Context.class: Context.java
|
||||
$(JAVAC) $(JAVACFLAGS) -d $(TMP_DIR) Context.java
|
||||
|
||||
$(TMP_DIR)\ase\awk\Extio.class: Extio.java
|
||||
$(JAVAC) $(JAVACFLAGS) -d $(TMP_DIR) Extio.java
|
||||
|
||||
$(TMP_DIR)\ase\awk\IO.class: IO.java
|
||||
$(JAVAC) $(JAVACFLAGS) -d $(TMP_DIR) IO.java
|
||||
|
||||
$(TMP_DIR)\ase\awk\Console.class: Console.java
|
||||
$(JAVAC) $(JAVACFLAGS) -d $(TMP_DIR) Console.java
|
||||
|
||||
$(TMP_DIR)\ase\awk\File.class: File.java
|
||||
$(JAVAC) $(JAVACFLAGS) -d $(TMP_DIR) File.java
|
||||
|
||||
$(TMP_DIR)\ase\awk\Pipe.class: Pipe.java
|
||||
$(JAVAC) $(JAVACFLAGS) -d $(TMP_DIR) Pipe.java
|
||||
|
||||
$(TMP_DIR)\ase\awk\Exception.class: Exception.java
|
||||
$(JAVAC) $(JAVACFLAGS) -d $(TMP_DIR) Exception.java
|
||||
|
||||
$(OUT_DIR):
|
||||
md $(OUT_DIR)
|
||||
|
||||
$(TMP_DIR):
|
||||
md $(TMP_DIR)
|
||||
|
||||
clean:
|
||||
del $(OUT_FILE_LIB)
|
||||
del $(OUT_FILE_JNI)
|
||||
del $(OUT_FILE_JAR)
|
||||
del $(OBJ_FILES_LIB)
|
||||
del $(OBJ_FILES_JNI)
|
||||
del $(OBJ_FILES_JAR)
|
||||
|
@ -1,29 +0,0 @@
|
||||
OUT = asecmn
|
||||
|
||||
C_SRCS = mem.c str.c misc.c
|
||||
C_OBJS = $(C_SRCS:.c=.obj)
|
||||
|
||||
CC = bcc32
|
||||
LD = ilink32
|
||||
AR = tlib
|
||||
JAVAC = javac
|
||||
|
||||
CFLAGS = -O2 -WM -WU -RT- -w -q -I../.. -DNDEBUG
|
||||
LDFLAGS = -Tpd -ap -Gn -c -q
|
||||
STARTUP = c0d32w.obj
|
||||
LIBS = import32.lib cw32mt.lib
|
||||
|
||||
all: lib
|
||||
|
||||
lib: $(C_OBJS)
|
||||
$(AR) $(OUT).lib @&&!
|
||||
+-$(**: = &^
|
||||
+-)
|
||||
!
|
||||
|
||||
clean:
|
||||
-del $(OBJS) $(OUT).lib *.obj
|
||||
|
||||
.SUFFIXES: .c .obj
|
||||
.c.obj:
|
||||
$(CC) $(CFLAGS) -c $<
|
@ -1,23 +0,0 @@
|
||||
OUT = asecmn
|
||||
|
||||
C_SRCS = mem.c str.c misc.c
|
||||
C_OBJS = $(C_SRCS:.c=.obj)
|
||||
|
||||
CC = cl
|
||||
LD = link
|
||||
|
||||
CFLAGS = /nologo /O2 /MT /W3 /GR- /GS- /Za -I../..
|
||||
|
||||
all: lib
|
||||
|
||||
lib: $(C_OBJS)
|
||||
$(LD) /lib @<<
|
||||
/nologo /out:$(OUT).lib $(C_OBJS)
|
||||
<<
|
||||
|
||||
clean:
|
||||
del $(OBJS) $(OUT).lib *.obj
|
||||
|
||||
.SUFFIXES: .c .obj
|
||||
.c.obj:
|
||||
$(CC) $(CFLAGS) /c $<
|
51
ase/cmn/msw-bcc.mak
Normal file
51
ase/cmn/msw-bcc.mak
Normal file
@ -0,0 +1,51 @@
|
||||
NAME = asecmn
|
||||
|
||||
!ifndef MODE
|
||||
MODE = release
|
||||
!endif
|
||||
|
||||
CC = bcc32
|
||||
LD = ilink32
|
||||
AR = tlib
|
||||
|
||||
CFLAGS = -O2 -WM -WU -RT- -w -q -I..\..
|
||||
|
||||
OUT_DIR = ..\$(MODE)\lib
|
||||
OUT_FILE_LIB = $(OUT_DIR)\$(NAME).lib
|
||||
|
||||
TMP_DIR = $(MODE)
|
||||
|
||||
OBJ_FILES_LIB = \
|
||||
$(TMP_DIR)\mem.obj \
|
||||
$(TMP_DIR)\str.obj \
|
||||
$(TMP_DIR)\misc.obj
|
||||
|
||||
all: lib
|
||||
|
||||
lib: $(TMP_DIR) $(OUT_DIR) $(OUT_FILE_LIB)
|
||||
|
||||
$(OUT_FILE_LIB): $(OBJ_FILES_LIB)
|
||||
$(AR) $(OUT_FILE_LIB) @&&!
|
||||
+-$(**: = &^
|
||||
+-)
|
||||
!
|
||||
|
||||
$(TMP_DIR)\mem.obj: mem.c
|
||||
$(CC) $(CFLAGS) -o$@ -c mem.c
|
||||
|
||||
$(TMP_DIR)\str.obj: str.c
|
||||
$(CC) $(CFLAGS) -o$@ -c str.c
|
||||
|
||||
$(TMP_DIR)\misc.obj: misc.c
|
||||
$(CC) $(CFLAGS) -o$@ -c misc.c
|
||||
|
||||
$(OUT_DIR):
|
||||
-md $(OUT_DIR)
|
||||
|
||||
$(TMP_DIR):
|
||||
-md $(TMP_DIR)
|
||||
|
||||
clean:
|
||||
-del $(OUT_FILE_LIB)
|
||||
-del $(OBJ_FILES_LIB)
|
||||
|
55
ase/cmn/msw-cl.mak
Normal file
55
ase/cmn/msw-cl.mak
Normal file
@ -0,0 +1,55 @@
|
||||
NAME = asecmn
|
||||
MODE = release
|
||||
|
||||
CC = cl
|
||||
LD = link
|
||||
AR = link
|
||||
|
||||
CFLAGS = /nologo /W3 -I..\..
|
||||
|
||||
!IF "$(MODE)" == "debug"
|
||||
CFLAGS = $(CFLAGS) -D_DEBUG -DDEBUG /MTd
|
||||
!ELSEIF "$(MODE)" == "release"
|
||||
CFLAGS = $(CFLAGS) -DNDEBUG /MT /O2
|
||||
!ELSE
|
||||
CFLAGS = $(CFLAGS) /MT
|
||||
!ENDIF
|
||||
|
||||
OUT_DIR = ..\$(MODE)\lib
|
||||
OUT_FILE_LIB = $(OUT_DIR)\$(NAME).lib
|
||||
|
||||
TMP_DIR = $(MODE)
|
||||
|
||||
OBJ_FILES_LIB = \
|
||||
$(TMP_DIR)\mem.obj \
|
||||
$(TMP_DIR)\str.obj \
|
||||
$(TMP_DIR)\misc.obj
|
||||
|
||||
all: lib
|
||||
|
||||
lib: $(OUT_FILE_LIB)
|
||||
|
||||
$(OUT_FILE_LIB): $(TMP_DIR) $(OUT_DIR) $(OBJ_FILES_LIB)
|
||||
$(AR) /lib @<<
|
||||
/nologo /out:$(OUT_FILE_LIB) $(OBJ_FILES_LIB)
|
||||
<<
|
||||
|
||||
$(TMP_DIR)\mem.obj: mem.c
|
||||
$(CC) $(CFLAGS) /Fo$@ /c mem.c
|
||||
|
||||
$(TMP_DIR)\str.obj: str.c
|
||||
$(CC) $(CFLAGS) /Fo$@ /c str.c
|
||||
|
||||
$(TMP_DIR)\misc.obj: misc.c
|
||||
$(CC) $(CFLAGS) /Fo$@ /c misc.c
|
||||
|
||||
$(OUT_DIR):
|
||||
-md $(OUT_DIR)
|
||||
|
||||
$(TMP_DIR):
|
||||
-md $(TMP_DIR)
|
||||
|
||||
clean:
|
||||
-del $(OUT_FILE_LIB)
|
||||
-del $(OBJ_FILES_LIB)
|
||||
|
@ -1,31 +0,0 @@
|
||||
OUT = aseutl
|
||||
|
||||
C_SRCS = main.c ctype.c stdio.c
|
||||
C_OBJS = $(C_SRCS:.c=.obj)
|
||||
|
||||
CC = bcc32
|
||||
LD = ilink32
|
||||
AR = tlib
|
||||
|
||||
CFLAGS = -O2 -WM -WU -RT- -w -q -I../.. -DNDEBUG
|
||||
|
||||
LDFLAGS = -Tpd -ap -Gn -c -q
|
||||
STARTUP = c0d32w.obj
|
||||
LIBS = import32.lib cw32mt.lib
|
||||
JNI_LIBS = $(LIBS) $(OUT).lib
|
||||
|
||||
all: lib
|
||||
|
||||
lib: $(C_OBJS)
|
||||
$(AR) $(OUT).lib @&&!
|
||||
+-$(**: = &^
|
||||
+-)
|
||||
!
|
||||
|
||||
clean:
|
||||
-del $(OBJS) $(OUT).lib *.obj
|
||||
|
||||
.SUFFIXES: .c .obj
|
||||
.c.obj:
|
||||
$(CC) $(CFLAGS) -c $<
|
||||
|
@ -1,23 +0,0 @@
|
||||
OUT = aseutl
|
||||
|
||||
C_SRCS = main.c ctype.c stdio.c
|
||||
C_OBJS = $(C_SRCS:.c=.obj)
|
||||
|
||||
CC = cl
|
||||
LD = link
|
||||
|
||||
CFLAGS = /nologo /O2 /MT /W3 /GR- /GS- /Za -I../.. -DNDEBUG
|
||||
|
||||
all: lib
|
||||
|
||||
lib: $(C_OBJS)
|
||||
$(LD) /lib @<<
|
||||
/nologo /out:$(OUT).lib $(C_OBJS)
|
||||
<<
|
||||
|
||||
clean:
|
||||
del $(OBJS) $(OUT).lib *.obj
|
||||
|
||||
.SUFFIXES: .c .obj
|
||||
.c.obj:
|
||||
$(CC) $(CFLAGS) /c $<
|
51
ase/utl/msw-bcc.mak
Normal file
51
ase/utl/msw-bcc.mak
Normal file
@ -0,0 +1,51 @@
|
||||
NAME = aseutl
|
||||
|
||||
!ifndef MODE
|
||||
MODE = release
|
||||
!endif
|
||||
|
||||
CC = bcc32
|
||||
LD = ilink32
|
||||
AR = tlib
|
||||
|
||||
CFLAGS = -O2 -WM -WU -RT- -w -q -I..\..
|
||||
|
||||
OUT_DIR = ..\$(MODE)\lib
|
||||
OUT_FILE_LIB = $(OUT_DIR)\$(NAME).lib
|
||||
|
||||
TMP_DIR = $(MODE)
|
||||
|
||||
OBJ_FILES_LIB = \
|
||||
$(TMP_DIR)\main.obj \
|
||||
$(TMP_DIR)\ctype.obj \
|
||||
$(TMP_DIR)\stdio.obj
|
||||
|
||||
all: lib
|
||||
|
||||
lib: $(TMP_DIR) $(OUT_DIR) $(OUT_FILE_LIB)
|
||||
|
||||
$(OUT_FILE_LIB): $(OBJ_FILES_LIB)
|
||||
$(AR) $(OUT_FILE_LIB) @&&!
|
||||
+-$(**: = &^
|
||||
+-)
|
||||
!
|
||||
|
||||
$(TMP_DIR)\main.obj: main.c
|
||||
$(CC) $(CFLAGS) -o$@ -c main.c
|
||||
|
||||
$(TMP_DIR)\ctype.obj: ctype.c
|
||||
$(CC) $(CFLAGS) -o$@ -c ctype.c
|
||||
|
||||
$(TMP_DIR)\stdio.obj: stdio.c
|
||||
$(CC) $(CFLAGS) -o$@ -c stdio.c
|
||||
|
||||
$(OUT_DIR):
|
||||
-md $(OUT_DIR)
|
||||
|
||||
$(TMP_DIR):
|
||||
-md $(TMP_DIR)
|
||||
|
||||
clean:
|
||||
-del $(OUT_FILE_LIB)
|
||||
-del $(OBJ_FILES_LIB)
|
||||
|
55
ase/utl/msw-cl.mak
Normal file
55
ase/utl/msw-cl.mak
Normal file
@ -0,0 +1,55 @@
|
||||
NAME = aseutl
|
||||
MODE = release
|
||||
|
||||
CC = cl
|
||||
LD = link
|
||||
AR = link
|
||||
|
||||
CFLAGS = /nologo /W3 -I..\..
|
||||
|
||||
!IF "$(MODE)" == "debug"
|
||||
CFLAGS = $(CFLAGS) -D_DEBUG -DDEBUG /MTd
|
||||
!ELSEIF "$(MODE)" == "release"
|
||||
CFLAGS = $(CFLAGS) -DNDEBUG /MT /O2
|
||||
!ELSE
|
||||
CFLAGS = $(CFLAGS) /MT
|
||||
!ENDIF
|
||||
|
||||
OUT_DIR = ..\$(MODE)\lib
|
||||
OUT_FILE_LIB = $(OUT_DIR)\$(NAME).lib
|
||||
|
||||
TMP_DIR = $(MODE)
|
||||
|
||||
OBJ_FILES_LIB = \
|
||||
$(TMP_DIR)\main.obj \
|
||||
$(TMP_DIR)\ctype.obj \
|
||||
$(TMP_DIR)\stdio.obj
|
||||
|
||||
all: lib
|
||||
|
||||
lib: $(OUT_FILE_LIB)
|
||||
|
||||
$(OUT_FILE_LIB): $(TMP_DIR) $(OUT_DIR) $(OBJ_FILES_LIB)
|
||||
$(AR) /lib @<<
|
||||
/nologo /out:$(OUT_FILE_LIB) $(OBJ_FILES_LIB)
|
||||
<<
|
||||
|
||||
$(TMP_DIR)\main.obj: main.c
|
||||
$(CC) $(CFLAGS) /Fo$@ /c main.c
|
||||
|
||||
$(TMP_DIR)\ctype.obj: ctype.c
|
||||
$(CC) $(CFLAGS) /Fo$@ /c ctype.c
|
||||
|
||||
$(TMP_DIR)\stdio.obj: stdio.c
|
||||
$(CC) $(CFLAGS) /Fo$@ /c stdio.c
|
||||
|
||||
$(OUT_DIR):
|
||||
-md $(OUT_DIR)
|
||||
|
||||
$(TMP_DIR):
|
||||
-md $(TMP_DIR)
|
||||
|
||||
clean:
|
||||
-del $(OUT_FILE_LIB)
|
||||
-del $(OBJ_FILES_LIB)
|
||||
|
Loading…
x
Reference in New Issue
Block a user