diff --git a/ase/cmd/awk/makefile.in b/ase/cmd/awk/makefile.in index 787a0b0a..6e22335b 100644 --- a/ase/cmd/awk/makefile.in +++ b/ase/cmd/awk/makefile.in @@ -14,8 +14,10 @@ LIBS_CXX = -laseawk++ ${LIBS} MODE = @BUILDMODE@ STRIP = @STRIP@ +AR = @AR@ -AR = ar +LIBTOOL_COMPILE = $(TOP_DIR)/libtool --mode=compile +LIBTOOL_LINK = $(TOP_DIR)/libtool --mode=link OUT_DIR= $(TOP_DIR)/out/$(MODE) OUT_DIR_LIB = $(OUT_DIR)/lib @@ -29,11 +31,11 @@ all: build build: $(TMP_DIR) $(OUT_DIR_BIN) $(OUT_DIR_BIN)/aseawk $(OUT_DIR_BIN)/aseawk++ $(OUT_DIR_BIN)/aseawk: awk.c - $(CC) $(CFLAGS) -o $@ awk.c $(LDFLAGS) $(LIBS) + $(LIBTOOL_LINK) $(CC) $(CFLAGS) -o $@ awk.c $(LDFLAGS) $(LIBS) $(STRIP) $@ $(OUT_DIR_BIN)/aseawk++: Awk.cpp - $(CXX) $(CXXFLAGS) -o $@ Awk.cpp $(LDFLAGS) $(LIBS_CXX) + $(LIBTOOL_LINK) $(CXX) $(CXXFLAGS) -o $@ Awk.cpp $(LDFLAGS) $(LIBS_CXX) $(STRIP) $@ $(OUT_DIR_BIN): diff --git a/ase/lib/awk/makefile.in b/ase/lib/awk/makefile.in index 1199dd5d..e3bbe36d 100644 --- a/ase/lib/awk/makefile.in +++ b/ase/lib/awk/makefile.in @@ -5,7 +5,9 @@ NAME = aseawk TOP_DIR = @abs_top_builddir@ -TOP_INSTALLDIR = @prefix@/ase + +PREFIX = @prefix@ +LIBDIR = $(PREFIX)/lib CC = @CC@ CXX = @CXX@ @@ -25,9 +27,9 @@ 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_LIB = $(OUT_DIR)/lib$(NAME).la OUT_FILE_JNI = $(OUT_DIR)/lib$(NAME)_jni.la -OUT_FILE_LIB_CXX = $(OUT_DIR)/lib$(NAME)++.a +OUT_FILE_LIB_CXX = $(OUT_DIR)/lib$(NAME)++.la TMP_DIR = $(MODE) TMP_DIR_CXX = $(TMP_DIR)/cxx @@ -51,7 +53,8 @@ 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) +#OBJ_FILES_SO = $(OBJ_FILES_LIB:.o=.lo) $(OBJ_FILES_JNI:.o=.lo) +OBJ_FILES_SO = $(OBJ_FILES_LIB:.o=.lo) lib: build$(BUILD_JNI) @@ -60,16 +63,18 @@ 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 + #$(AR) cr $(OUT_FILE_LIB) $(OBJ_FILES_LIB) + $(LIBTOOL_LINK) $(CC) -rpath $(LIBDIR) -version-info 1:0:0 -o $@ $(OBJ_FILES_SO) -L$(OUT_DIR) -lasecmn + #[ ! -z "$(RANLIB)" ] && $(RANLIB) $(OUT_FILE_LIB) $(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 + #$(AR) cr $(OUT_FILE_LIB_CXX) $(OBJ_FILES_LIB_CXX) + $(LIBTOOL_LINK) $(CC) -rpath $(LIBDIR) -version-info 1:0:0 -o $@ $(OBJ_FILES_SO) -L$(OUT_DIR) -laseawk -lasecmn + #[ ! -z "$(RANLIB)" ] && $(RANLIB) $(OUT_FILE_LIB_CXX) $(TMP_DIR)/awk.o: awk.c $(LIBTOOL_COMPILE) $(CC) $(CFLAGS) -o $@ -c awk.c