2007-10-14 21:36:00 +00:00
|
|
|
NAME = aseawk
|
2007-10-16 01:15:00 +00:00
|
|
|
MODE = release
|
2007-10-14 21:36:00 +00:00
|
|
|
|
|
|
|
JNI_INC = \
|
2007-10-16 01:15:00 +00:00
|
|
|
-I"$(JAVA_HOME)\include" \
|
|
|
|
-I"$(JAVA_HOME)\include\win32"
|
2007-10-14 21:36:00 +00:00
|
|
|
|
2007-10-16 01:15:00 +00:00
|
|
|
CC = cl
|
|
|
|
CXX = cl
|
2007-10-14 21:36:00 +00:00
|
|
|
LD = link
|
2007-10-16 01:15:00 +00:00
|
|
|
AR = link
|
2007-10-14 21:36:00 +00:00
|
|
|
JAVAC = javac
|
2007-10-16 01:15:00 +00:00
|
|
|
JAR = jar
|
2007-10-14 21:36:00 +00:00
|
|
|
|
2007-10-16 01:15:00 +00:00
|
|
|
CFLAGS = /nologo /W3 -I..\..
|
|
|
|
CXXFLAGS = /nologo /W3 -I..\..
|
2007-10-14 21:36:00 +00:00
|
|
|
JAVACFLAGS = -classpath ..\.. -Xlint:unchecked
|
|
|
|
|
2007-10-24 00:18:00 +00:00
|
|
|
#LDFLAGS = /subsystem:console
|
|
|
|
LDFLAGS = /subsystem:windows
|
|
|
|
|
2007-10-16 01:15:00 +00:00
|
|
|
!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
|
2007-10-14 21:36:00 +00:00
|
|
|
|
|
|
|
OUT_DIR = ..\$(MODE)\lib
|
|
|
|
OUT_FILE_LIB = $(OUT_DIR)\$(NAME).lib
|
2007-10-16 01:15:00 +00:00
|
|
|
OUT_FILE_JNI = $(OUT_DIR)\$(NAME)_jni.dll
|
|
|
|
OUT_FILE_LIB_CXX = $(OUT_DIR)\$(NAME)++.lib
|
|
|
|
OUT_FILE_JAR = $(OUT_DIR)\$(NAME).jar
|
2007-10-14 21:36:00 +00:00
|
|
|
|
|
|
|
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 = \
|
2007-10-16 01:15:00 +00:00
|
|
|
$(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
|
2007-10-14 21:36:00 +00:00
|
|
|
|
2007-10-16 01:15:00 +00:00
|
|
|
all: lib
|
2007-10-14 21:36:00 +00:00
|
|
|
|
2007-10-16 01:15:00 +00:00
|
|
|
lib: $(OUT_FILE_LIB) $(OUT_FILE_LIB_CXX)
|
2007-10-14 21:36:00 +00:00
|
|
|
|
2007-10-16 01:15:00 +00:00
|
|
|
jnidll: $(OUT_FILE_JNI)
|
|
|
|
|
|
|
|
jar: $(OUT_FILE_JAR)
|
2007-10-14 21:36:00 +00:00
|
|
|
|
|
|
|
$(OUT_FILE_LIB): $(TMP_DIR) $(OUT_DIR) $(OBJ_FILES_LIB)
|
2007-10-16 01:15:00 +00:00
|
|
|
$(AR) /lib @<<
|
|
|
|
/nologo /out:$(OUT_FILE_LIB) $(OBJ_FILES_LIB)
|
|
|
|
<<
|
|
|
|
|
|
|
|
$(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)
|
2007-10-24 00:18:00 +00:00
|
|
|
$(LD) /dll /def:jni.def $(LDFLAGS) /release @<<
|
2007-10-16 01:15:00 +00:00
|
|
|
/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
|
2007-10-14 21:36:00 +00:00
|
|
|
|
2007-10-16 01:15:00 +00:00
|
|
|
|
|
|
|
$(OUT_FILE_JAR): $(OBJ_FILES_JAR)
|
|
|
|
$(JAR) -Mcvf $(OUT_FILE_JAR) -C $(TMP_DIR) ase
|
2007-10-14 21:36:00 +00:00
|
|
|
|
|
|
|
$(TMP_DIR)\awk.obj: awk.c
|
2007-10-16 01:15:00 +00:00
|
|
|
$(CC) $(CFLAGS) /Fo$@ /c awk.c
|
2007-10-14 21:36:00 +00:00
|
|
|
|
|
|
|
$(TMP_DIR)\err.obj: err.c
|
2007-10-16 01:15:00 +00:00
|
|
|
$(CC) $(CFLAGS) /Fo$@ /c err.c
|
2007-10-14 21:36:00 +00:00
|
|
|
|
|
|
|
$(TMP_DIR)\tree.obj: tree.c
|
2007-10-16 01:15:00 +00:00
|
|
|
$(CC) $(CFLAGS) /Fo$@ /c tree.c
|
2007-10-14 21:36:00 +00:00
|
|
|
|
|
|
|
$(TMP_DIR)\tab.obj: tab.c
|
2007-10-16 01:15:00 +00:00
|
|
|
$(CC) $(CFLAGS) /Fo$@ /c tab.c
|
2007-10-14 21:36:00 +00:00
|
|
|
|
|
|
|
$(TMP_DIR)\map.obj: map.c
|
2007-10-16 01:15:00 +00:00
|
|
|
$(CC) $(CFLAGS) /Fo$@ /c map.c
|
2007-10-14 21:36:00 +00:00
|
|
|
|
|
|
|
$(TMP_DIR)\parse.obj: parse.c
|
2007-10-16 01:15:00 +00:00
|
|
|
$(CC) $(CFLAGS) /Fo$@ /c parse.c
|
2007-10-14 21:36:00 +00:00
|
|
|
|
|
|
|
$(TMP_DIR)\run.obj: run.c
|
2007-10-16 01:15:00 +00:00
|
|
|
$(CC) $(CFLAGS) /Fo$@ /c run.c
|
2007-10-14 21:36:00 +00:00
|
|
|
|
|
|
|
$(TMP_DIR)\rec.obj: rec.c
|
2007-10-16 01:15:00 +00:00
|
|
|
$(CC) $(CFLAGS) /Fo$@ /c rec.c
|
2007-10-14 21:36:00 +00:00
|
|
|
|
|
|
|
$(TMP_DIR)\val.obj: val.c
|
2007-10-16 01:15:00 +00:00
|
|
|
$(CC) $(CFLAGS) /Fo$@ /c val.c
|
2007-10-14 21:36:00 +00:00
|
|
|
|
|
|
|
$(TMP_DIR)\func.obj: func.c
|
2007-10-16 01:15:00 +00:00
|
|
|
$(CC) $(CFLAGS) /Fo$@ /c func.c
|
2007-10-14 21:36:00 +00:00
|
|
|
|
|
|
|
$(TMP_DIR)\misc.obj: misc.c
|
2007-10-16 01:15:00 +00:00
|
|
|
$(CC) $(CFLAGS) /Fo$@ /c misc.c
|
2007-10-14 21:36:00 +00:00
|
|
|
|
|
|
|
$(TMP_DIR)\extio.obj: extio.c
|
2007-10-16 01:15:00 +00:00
|
|
|
$(CC) $(CFLAGS) /Fo$@ /c extio.c
|
2007-10-14 21:36:00 +00:00
|
|
|
|
|
|
|
$(TMP_DIR)\rex.obj: rex.c
|
2007-10-16 01:15:00 +00:00
|
|
|
$(CC) $(CFLAGS) /Fo$@ /c rex.c
|
2007-10-14 21:36:00 +00:00
|
|
|
|
|
|
|
$(TMP_DIR)\jni.obj: jni.c
|
2007-10-16 01:15:00 +00:00
|
|
|
$(CC) $(CFLAGS) $(JNI_INC) /Fo$@ /c jni.c
|
2007-10-14 21:36:00 +00:00
|
|
|
|
|
|
|
$(TMP_DIR)\cxx\Awk.obj: Awk.cpp Awk.hpp
|
2007-10-16 01:15:00 +00:00
|
|
|
$(CXX) $(CXXFLAGS) /Fo$@ /c Awk.cpp
|
2007-10-14 21:36:00 +00:00
|
|
|
|
|
|
|
$(TMP_DIR)\cxx\StdAwk.obj: StdAwk.cpp StdAwk.hpp Awk.hpp
|
2007-10-16 01:15:00 +00:00
|
|
|
$(CXX) $(CXXFLAGS) /Fo$@ /c StdAwk.cpp
|
|
|
|
|
|
|
|
$(TMP_DIR)\ase\awk\Awk.class: Awk.java
|
|
|
|
$(JAVAC) $(JAVACFLAGS) -d $(TMP_DIR) Awk.java
|
2007-10-14 21:36:00 +00:00
|
|
|
|
2007-10-16 01:15:00 +00:00
|
|
|
$(TMP_DIR)\ase\awk\StdAwk.class: StdAwk.java
|
|
|
|
$(JAVAC) $(JAVACFLAGS) -d $(TMP_DIR) StdAwk.java
|
2007-10-14 21:36:00 +00:00
|
|
|
|
2007-10-16 01:15:00 +00:00
|
|
|
$(TMP_DIR)\ase\awk\Context.class: Context.java
|
|
|
|
$(JAVAC) $(JAVACFLAGS) -d $(TMP_DIR) Context.java
|
2007-10-14 21:36:00 +00:00
|
|
|
|
2007-10-16 01:15:00 +00:00
|
|
|
$(TMP_DIR)\ase\awk\Extio.class: Extio.java
|
|
|
|
$(JAVAC) $(JAVACFLAGS) -d $(TMP_DIR) Extio.java
|
2007-10-14 21:36:00 +00:00
|
|
|
|
2007-10-16 01:15:00 +00:00
|
|
|
$(TMP_DIR)\ase\awk\IO.class: IO.java
|
|
|
|
$(JAVAC) $(JAVACFLAGS) -d $(TMP_DIR) IO.java
|
2007-10-14 21:36:00 +00:00
|
|
|
|
2007-10-16 01:15:00 +00:00
|
|
|
$(TMP_DIR)\ase\awk\Console.class: Console.java
|
|
|
|
$(JAVAC) $(JAVACFLAGS) -d $(TMP_DIR) Console.java
|
2007-10-14 21:36:00 +00:00
|
|
|
|
2007-10-16 01:15:00 +00:00
|
|
|
$(TMP_DIR)\ase\awk\File.class: File.java
|
|
|
|
$(JAVAC) $(JAVACFLAGS) -d $(TMP_DIR) File.java
|
2007-10-14 21:36:00 +00:00
|
|
|
|
2007-10-16 01:15:00 +00:00
|
|
|
$(TMP_DIR)\ase\awk\Pipe.class: Pipe.java
|
|
|
|
$(JAVAC) $(JAVACFLAGS) -d $(TMP_DIR) Pipe.java
|
2007-10-14 21:36:00 +00:00
|
|
|
|
2007-10-16 01:15:00 +00:00
|
|
|
$(TMP_DIR)\ase\awk\Exception.class: Exception.java
|
|
|
|
$(JAVAC) $(JAVACFLAGS) -d $(TMP_DIR) Exception.java
|
2007-10-14 21:36:00 +00:00
|
|
|
|
|
|
|
$(OUT_DIR):
|
2007-10-16 01:15:00 +00:00
|
|
|
-md $(OUT_DIR)
|
2007-10-14 21:36:00 +00:00
|
|
|
|
|
|
|
$(TMP_DIR):
|
2007-10-16 01:15:00 +00:00
|
|
|
-md $(TMP_DIR)
|
2007-10-14 21:36:00 +00:00
|
|
|
|
|
|
|
$(TMP_DIR_CXX): $(TMP_DIR)
|
2007-10-16 01:15:00 +00:00
|
|
|
-md $(TMP_DIR_CXX)
|
2007-10-14 21:36:00 +00:00
|
|
|
|
|
|
|
clean:
|
2007-10-16 01:15:00 +00:00
|
|
|
-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)
|
2007-10-14 21:36:00 +00:00
|
|
|
|