129 lines
3.1 KiB
Makefile
129 lines
3.1 KiB
Makefile
#
|
|
# $Id: makefile.in,v 1.10 2007/10/15 16:15:42 bacon Exp $
|
|
#
|
|
|
|
NAME = aseawk
|
|
|
|
TOP_DIR = @abs_top_builddir@
|
|
TOP_INSTALLDIR = @prefix@/ase
|
|
|
|
CC = @CC@
|
|
CXX = @CXX@
|
|
AR = @AR@
|
|
RANLIB = @RANLIB@
|
|
|
|
CFLAGS = @CFLAGS@ -I$(TOP_DIR)/inc
|
|
CXXFLAGS = @CXXFLAGS@ -I$(TOP_DIR)/inc
|
|
LDFLAGS = @LDFLAGS@
|
|
LIBS = @LIBS@
|
|
MODE = @BUILDMODE@
|
|
|
|
CFLAGS_JNI = @CFLAGS_JNI@
|
|
BUILD_JNI = @BUILD_JNI@
|
|
|
|
LIBTOOL_COMPILE = $(TOP_DIR)/libtool --mode=compile
|
|
LIBTOOL_LINK = $(TOP_DIR)/libtool --mode=link
|
|
|
|
OUT_DIR = $(TOP_DIR)/out/$(MODE)/lib
|
|
OUT_FILE_LIB = $(OUT_DIR)/lib$(NAME).a
|
|
OUT_FILE_JNI = $(OUT_DIR)/lib$(NAME)_jni.la
|
|
OUT_FILE_LIB_CXX = $(OUT_DIR)/lib$(NAME)++.a
|
|
|
|
TMP_DIR = $(MODE)
|
|
TMP_DIR_CXX = $(TMP_DIR)/cxx
|
|
|
|
OBJ_FILES_LIB = \
|
|
$(TMP_DIR)/awk.o \
|
|
$(TMP_DIR)/err.o \
|
|
$(TMP_DIR)/tree.o \
|
|
$(TMP_DIR)/tab.o \
|
|
$(TMP_DIR)/parse.o \
|
|
$(TMP_DIR)/run.o \
|
|
$(TMP_DIR)/rec.o \
|
|
$(TMP_DIR)/val.o \
|
|
$(TMP_DIR)/func.o \
|
|
$(TMP_DIR)/misc.o \
|
|
$(TMP_DIR)/extio.o
|
|
|
|
OBJ_FILES_JNI = $(TMP_DIR)/jni.o
|
|
|
|
OBJ_FILES_LIB_CXX = \
|
|
$(TMP_DIR)/cxx/Awk.o \
|
|
$(TMP_DIR)/cxx/StdAwk.o
|
|
|
|
OBJ_FILES_SO = $(OBJ_FILES_LIB:.o=.lo) $(OBJ_FILES_JNI:.o=.lo)
|
|
|
|
lib: build$(BUILD_JNI)
|
|
|
|
build: $(OUT_FILE_LIB) $(OUT_FILE_LIB_CXX)
|
|
|
|
buildjni: build $(OUT_FILE_JNI)
|
|
|
|
$(OUT_FILE_LIB): $(TMP_DIR) $(OUT_DIR) $(OBJ_FILES_LIB)
|
|
$(AR) cr $(OUT_FILE_LIB) $(OBJ_FILES_LIB)
|
|
if [ ! -z "$(RANLIB)" ]; then $(RANLIB) $(OUT_FILE_LIB); fi
|
|
|
|
$(OUT_FILE_JNI): $(TMP_DIR) $(OBJ_FILES_JNI) $(OBJ_FILES_JAR) $(OUT_FILE_LIB)
|
|
$(LIBTOOL_LINK) $(CC) -rpath $(TOP_INSTALLDIR)/lib -version-info 1:0:0 -o $(OUT_FILE_JNI) $(OBJ_FILES_SO) -lm -L$(OUT_DIR) -l$(NAME) -lasecmn -laseutl
|
|
$(JAR) -Mcvf $(OUT_FILE_JAR) -C $(TMP_DIR) ase
|
|
|
|
$(OUT_FILE_LIB_CXX): $(TMP_DIR_CXX) $(OUT_DIR) $(OUT_FILE_LIB) $(OBJ_FILES_LIB_CXX)
|
|
$(AR) cr $(OUT_FILE_LIB_CXX) $(OBJ_FILES_LIB_CXX)
|
|
if [ ! -z "$(RANLIB)" ]; then $(RANLIB) $(OUT_FILE_LIB_CXX); fi
|
|
|
|
$(TMP_DIR)/awk.o: awk.c
|
|
$(LIBTOOL_COMPILE) $(CC) $(CFLAGS) -o $@ -c awk.c
|
|
|
|
$(TMP_DIR)/err.o: err.c
|
|
$(LIBTOOL_COMPILE) $(CC) $(CFLAGS) -o $@ -c err.c
|
|
|
|
$(TMP_DIR)/tree.o: tree.c
|
|
$(LIBTOOL_COMPILE) $(CC) $(CFLAGS) -o $@ -c tree.c
|
|
|
|
$(TMP_DIR)/tab.o: tab.c
|
|
$(LIBTOOL_COMPILE) $(CC) $(CFLAGS) -o $@ -c tab.c
|
|
|
|
$(TMP_DIR)/parse.o: parse.c
|
|
$(LIBTOOL_COMPILE) $(CC) $(CFLAGS) -o $@ -c parse.c
|
|
|
|
$(TMP_DIR)/run.o: run.c
|
|
$(LIBTOOL_COMPILE) $(CC) $(CFLAGS) -o $@ -c run.c
|
|
|
|
$(TMP_DIR)/rec.o: rec.c
|
|
$(LIBTOOL_COMPILE) $(CC) $(CFLAGS) -o $@ -c rec.c
|
|
|
|
$(TMP_DIR)/val.o: val.c
|
|
$(LIBTOOL_COMPILE) $(CC) $(CFLAGS) -o $@ -c val.c
|
|
|
|
$(TMP_DIR)/func.o: func.c
|
|
$(LIBTOOL_COMPILE) $(CC) $(CFLAGS) -o $@ -c func.c
|
|
|
|
$(TMP_DIR)/misc.o: misc.c
|
|
$(LIBTOOL_COMPILE) $(CC) $(CFLAGS) -o $@ -c misc.c
|
|
|
|
$(TMP_DIR)/extio.o: extio.c
|
|
$(LIBTOOL_COMPILE) $(CC) $(CFLAGS) -o $@ -c extio.c
|
|
|
|
$(TMP_DIR)/jni.o: jni.c
|
|
$(LIBTOOL_COMPILE) $(CC) $(CFLAGS) $(CFLAGS_JNI) -o $@ -c jni.c
|
|
|
|
$(TMP_DIR)/cxx/Awk.o: Awk.cpp
|
|
$(CXX) $(CXXFLAGS) -o $@ -c Awk.cpp
|
|
|
|
$(TMP_DIR)/cxx/StdAwk.o: StdAwk.cpp
|
|
$(CXX) $(CXXFLAGS) -o $@ -c StdAwk.cpp
|
|
|
|
$(OUT_DIR):
|
|
mkdir -p $(OUT_DIR)
|
|
|
|
$(TMP_DIR):
|
|
mkdir -p $(TMP_DIR)
|
|
|
|
$(TMP_DIR_CXX): $(TMP_DIR)
|
|
mkdir -p $(TMP_DIR_CXX)
|
|
|
|
clean:
|
|
rm -rf $(OUT_FILE_LIB) $(OUT_FILE_JNI) $(OUT_FILE_LIB_CXX)
|
|
rm -rf $(OBJ_FILES_LIB) $(OBJ_FILES_JNI) $(OBJ_FILES_LIB_CXX)
|
|
|