2006-11-14 10:24:20 +00:00
|
|
|
OUT = aseawk
|
|
|
|
|
|
|
|
C_SRCS = awk.c err.c tree.c str.c tab.c map.c parse.c \
|
2006-10-03 14:43:38 +00:00
|
|
|
run.c rec.c val.c func.c misc.c extio.c rex.c
|
2006-12-12 05:16:30 +00:00
|
|
|
JNI_SRCS = jni.c
|
2006-11-24 13:25:12 +00:00
|
|
|
JAVA_SRCS = Exception.java Extio.java Awk.java StdAwk.java
|
2006-11-14 10:24:20 +00:00
|
|
|
|
|
|
|
C_OBJS = $(C_SRCS:.c=.obj)
|
|
|
|
JNI_OBJS = $(JNI_SRCS:.c=.obj)
|
|
|
|
JAVA_OBJS = $(JAVA_SRCS:.java=.class)
|
|
|
|
|
2006-11-29 11:41:15 +00:00
|
|
|
JNI_INCPATH = \
|
2007-01-18 14:00:07 +00:00
|
|
|
-I"$(JAVA_HOME)/include" \
|
|
|
|
-I"$(JAVA_HOME)/include/win32"
|
|
|
|
BDS_LIBPATH = -L"c:/program files/borland/bds/4.0/lib"
|
2005-09-30 09:40:15 +00:00
|
|
|
|
|
|
|
CC = bcc32
|
2006-11-14 10:24:20 +00:00
|
|
|
LD = ilink32
|
|
|
|
AR = tlib
|
|
|
|
JAVAC = javac
|
|
|
|
|
2007-01-18 14:00:07 +00:00
|
|
|
CFLAGS_COMMON = -O2 -WM -WU -RT- -w -q -I../.. $(JNI_INCPATH)
|
2006-10-28 05:24:08 +00:00
|
|
|
CFLAGS_RELEASE = $(CFLAGS_COMMON) -DNDEBUG
|
2006-12-04 06:50:26 +00:00
|
|
|
CFLAGS_DEBUG = $(CFLAGS_COMMON) -D_DEBUG #-DDEBUG_REX
|
2006-10-28 05:24:08 +00:00
|
|
|
CFLAGS = $(CFLAGS_DEBUG)
|
2006-12-03 06:53:25 +00:00
|
|
|
#CFLAGS = $(CFLAGS_RELEASE)
|
2006-11-14 10:24:20 +00:00
|
|
|
JAVACFLAGS = -classpath ../..
|
|
|
|
|
2006-11-29 11:41:15 +00:00
|
|
|
LDFLAGS = -Tpd -ap -Gn -c -q $(BDS_LIBPATH)
|
2006-11-14 10:24:20 +00:00
|
|
|
STARTUP = c0d32w.obj
|
|
|
|
LIBS = import32.lib cw32mt.lib
|
2006-12-12 05:16:30 +00:00
|
|
|
JNI_LIBS = $(LIBS) $(OUT).lib
|
2005-09-30 09:40:15 +00:00
|
|
|
|
2006-11-14 10:24:20 +00:00
|
|
|
all: lib jni
|
|
|
|
|
|
|
|
lib: $(C_OBJS)
|
2006-12-12 05:16:30 +00:00
|
|
|
$(AR) $(OUT).lib @&&!
|
2005-09-30 09:40:15 +00:00
|
|
|
+-$(**: = &^
|
|
|
|
+-)
|
|
|
|
!
|
|
|
|
|
2006-12-12 05:16:30 +00:00
|
|
|
jni: lib $(JNI_OBJS) $(JAVA_OBJS)
|
|
|
|
$(LD) $(LDFLAGS) $(STARTUP) $(JNI_OBJS),$(OUT).dll,,$(JNI_LIBS),jni.def,
|
2006-11-14 10:24:20 +00:00
|
|
|
|
2005-09-30 09:40:15 +00:00
|
|
|
clean:
|
2006-11-14 10:24:20 +00:00
|
|
|
-del $(OBJS) $(OUT).lib $(OUT).dll *.obj *.class
|
2005-09-30 09:40:15 +00:00
|
|
|
|
2006-11-14 10:24:20 +00:00
|
|
|
.SUFFIXES: .c .obj .java .class
|
2005-09-30 09:40:15 +00:00
|
|
|
.c.obj:
|
|
|
|
$(CC) $(CFLAGS) -c $<
|
|
|
|
|
2006-11-14 10:24:20 +00:00
|
|
|
.java.class:
|
|
|
|
$(JAVAC) $(JAVACFLAGS) $<
|