2007-11-11 00:30:00 +00:00
|
|
|
NAME = aseawk
|
|
|
|
MODE = release
|
|
|
|
|
|
|
|
CC = cl
|
|
|
|
CXX = cl
|
|
|
|
LD = link
|
2007-11-14 17:37:00 +00:00
|
|
|
JAVAC = javac
|
|
|
|
JAR = jar
|
2007-11-11 00:30:00 +00:00
|
|
|
|
|
|
|
CFLAGS = /nologo /W3 -I..\..\..
|
|
|
|
CXXFLAGS = /nologo /W3 -I..\..\..
|
2007-11-14 17:37:00 +00:00
|
|
|
JAVACFLAGS = -classpath ..\..\$(MODE)\lib\aseawk.jar;. -Xlint:unchecked
|
2007-11-11 00:30:00 +00:00
|
|
|
|
|
|
|
LDFLAGS = /libpath:..\..\$(MODE)\lib
|
|
|
|
LIBS = asecmn.lib aseawk.lib aseutl.lib kernel32.lib user32.lib
|
|
|
|
LIBS_CXX = $(LIBS) aseawk++.lib
|
|
|
|
|
|
|
|
!IF "$(MODE)" == "debug"
|
2007-12-09 07:57:27 +00:00
|
|
|
CFLAGS = $(CFLAGS) -D_DEBUG -DDEBUG /MTd /Zi
|
|
|
|
CXXFLAGS = $(CXXFLAGS) -D_DEBUG -DDEBUG /MTd /Zi
|
2007-11-11 00:30:00 +00:00
|
|
|
!ELSEIF "$(MODE)" == "release"
|
|
|
|
CFLAGS = $(CFLAGS) -DNDEBUG /MT /O2
|
|
|
|
CXXFLAGS = $(CXXFLAGS) -DNDEBUG /MT /O2
|
|
|
|
!ELSE
|
|
|
|
CFLAGS = $(CFLAGS) /MT
|
|
|
|
CXXFLAGS = $(CXXFLAGS) /MT
|
|
|
|
!ENDIF
|
|
|
|
|
|
|
|
!if !defined(CPU) || "$(CPU)" == ""
|
|
|
|
CPU = $(PROCESSOR_ARCHITECTURE)
|
|
|
|
!endif
|
|
|
|
|
|
|
|
!if "$(CPU)" == ""
|
|
|
|
CPU = i386
|
|
|
|
!endif
|
|
|
|
|
|
|
|
!if "$(CPU)" == "IA64" || "$(CPU)" == "AMD64"
|
|
|
|
# comment out the following line if you encounter this link error.
|
|
|
|
# LINK : fatal error LNK1181: cannot open input file 'bufferoverflowu.lib'
|
|
|
|
LIBS = $(LIBS) bufferoverflowu.lib
|
|
|
|
!endif
|
|
|
|
|
|
|
|
OUT_DIR = ..\..\$(MODE)\bin
|
|
|
|
OUT_FILE_BIN = $(OUT_DIR)\$(NAME).exe
|
|
|
|
OUT_FILE_BIN_CXX = $(OUT_DIR)\$(NAME)++.exe
|
2007-11-14 17:37:00 +00:00
|
|
|
OUT_FILE_JAR = $(OUT_DIR)\$(NAME).jar
|
2007-11-11 00:30:00 +00:00
|
|
|
|
|
|
|
TMP_DIR = $(MODE)
|
|
|
|
TMP_DIR_CXX = $(TMP_DIR)\cxx
|
2007-11-14 17:37:00 +00:00
|
|
|
TMP_DIR_JAR = $(TMP_DIR)\java
|
2007-11-11 00:30:00 +00:00
|
|
|
|
|
|
|
OBJ_FILES_BIN = $(TMP_DIR)\awk.obj
|
|
|
|
OBJ_FILES_BIN_CXX = $(TMP_DIR_CXX)\Awk.obj
|
|
|
|
|
2007-11-14 17:37:00 +00:00
|
|
|
OBJ_FILES_JAR = \
|
|
|
|
$(TMP_DIR_JAR)\AseAwk.class \
|
|
|
|
$(TMP_DIR_JAR)\AseAwkPanel.class \
|
|
|
|
$(TMP_DIR_JAR)\AseAwkApplet.class
|
|
|
|
|
|
|
|
TARGETS = bin
|
|
|
|
|
|
|
|
!if "$(JAVA_HOME)" != ""
|
|
|
|
TARGETS = $(TARGETS) jar
|
|
|
|
!endif
|
|
|
|
|
|
|
|
|
|
|
|
all: $(TARGETS)
|
2007-11-11 00:30:00 +00:00
|
|
|
|
|
|
|
bin: $(OUT_FILE_BIN) $(OUT_FILE_BIN_CXX)
|
|
|
|
|
2007-11-14 17:37:00 +00:00
|
|
|
jar: $(OUT_FILE_JAR)
|
|
|
|
|
|
|
|
|
2007-11-11 00:30:00 +00:00
|
|
|
$(OUT_FILE_BIN): $(TMP_DIR) $(OUT_DIR) $(OBJ_FILES_BIN)
|
2007-12-23 01:43:50 +00:00
|
|
|
$(LD) /nologo /out:$@ $(LDFLAGS) $(LIBS) $(OBJ_FILES_BIN)
|
2007-11-11 00:30:00 +00:00
|
|
|
|
|
|
|
$(OUT_FILE_BIN_CXX): $(TMP_DIR_CXX) $(OUT_FILE_BIN) $(OBJ_FILES_BIN_CXX)
|
|
|
|
$(LD) /nologo /out:$@ $(LDFLAGS) $(LIBS_CXX) $(OBJ_FILES_BIN_CXX)
|
|
|
|
|
2007-11-14 17:37:00 +00:00
|
|
|
$(OUT_FILE_JAR): $(TMP_DIR_JAR) $(OBJ_FILES_JAR)
|
|
|
|
$(JAR) -xvf ..\..\$(MODE)\lib\aseawk.jar
|
|
|
|
$(JAR) -cvfm $(OUT_FILE_JAR) manifest ase -C $(TMP_DIR_JAR) .
|
|
|
|
|
2007-11-11 00:30:00 +00:00
|
|
|
$(TMP_DIR)\awk.obj: awk.c
|
|
|
|
$(CC) $(CFLAGS) /Fo$@ /c awk.c
|
|
|
|
|
|
|
|
$(TMP_DIR_CXX)\Awk.obj: Awk.cpp
|
|
|
|
$(CC) $(CXXFLAGS) /Fo$@ /c Awk.cpp
|
|
|
|
|
2007-11-14 17:37:00 +00:00
|
|
|
$(TMP_DIR_JAR)\AseAwk.class: AseAwk.java
|
|
|
|
$(JAVAC) $(JAVACFLAGS) -d $(TMP_DIR_JAR) AseAwk.java
|
|
|
|
|
|
|
|
$(TMP_DIR_JAR)\AseAwkApplet.class: AseAwkApplet.java
|
|
|
|
$(JAVAC) $(JAVACFLAGS) -d $(TMP_DIR_JAR) AseAwkApplet.java
|
|
|
|
|
|
|
|
$(TMP_DIR_JAR)\AseAwkPanel.class: AseAwkPanel.java
|
|
|
|
$(JAVAC) $(JAVACFLAGS) -d $(TMP_DIR_JAR) AseAwkPanel.java
|
|
|
|
|
2007-11-11 00:30:00 +00:00
|
|
|
$(OUT_DIR):
|
|
|
|
-md $(OUT_DIR)
|
|
|
|
|
|
|
|
$(TMP_DIR):
|
|
|
|
-md $(TMP_DIR)
|
|
|
|
|
|
|
|
$(TMP_DIR_CXX): $(TMP_DIR)
|
|
|
|
-md $(TMP_DIR_CXX)
|
|
|
|
|
2007-11-14 17:37:00 +00:00
|
|
|
$(TMP_DIR_JAR): $(TMP_DIR)
|
|
|
|
-md $(TMP_DIR_JAR)
|
|
|
|
|
2007-11-11 00:30:00 +00:00
|
|
|
clean:
|
|
|
|
-del $(OUT_FILE_BIN)
|
|
|
|
-del $(OUT_FILE_BIN_CXX)
|
|
|
|
-del $(OBJ_FILES_BIN)
|
|
|
|
-del $(OBJ_FILES_BIN_CXX)
|
2007-11-14 17:37:00 +00:00
|
|
|
-del $(OUT_FILE_JAR)
|
|
|
|
-del $(OBJ_FILES_JAR)
|
|
|
|
-del $(TMP_DIR)\*.class
|