--- Makefile.orig 2018-10-21 15:13:22.000000000 -0400
+++ Makefile 2018-10-22 13:36:03.000000000 -0400
+installname = -install_name $(prefix)/lib/
CBASEFLAGS = -W -Wall -std=c++11 -stdlib=libc++ -fno-rtti -fno-exceptions \
-mmacosx-version-min=10.9
-JAVAINCS = -I/Library/Java/JavaVirtualMachines/jdk1.8.0_45.jdk/Contents/Home/include \
--I/Library/Java/JavaVirtualMachines/jdk1.8.0_45.jdk/Contents/Home/include/darwin \
--I/System/Library/Frameworks/JavaVM.framework/Headers
+JAVAINCS = -I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/darwin
-INSTALL=install -o $(USER) -g wheel
# INSTALL=install -o 0 -g 0
+ installname = -Wl,-soname,
JAVAINCS = -I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/linux
$(CXX) $(LDFLAGSd) -o $(bindir)/AStyled $^
-shared: libastyle.$(dylib)
-libastyle.$(dylib): $(OBJs)
+shared: libastyle31.$(dylib)
+libastyle31.$(dylib): $(OBJs)
- $(CXX) $(dynamiclib) $(LDFLAGSr) -o $(bindir)/libastyle31.$(dylib) $^
+ $(CXX) $(dynamiclib) $(installname)libastyle31.$(dylib) $(LDFLAGSr) -o $(bindir)/$@ $^
shareddebug: libastyled.$(dylib)
-java: libastylej.$(dylib)
-libastylej.$(dylib): $(OBJsj)
+java: libastyle31j.$(dylib)
+libastyle31j.$(dylib): $(OBJsj)
- $(CXX) $(dynamiclib) $(LDFLAGSr) -o $(bindir)/libastyle31j.$(dylib) $^
+ $(CXX) $(dynamiclib) $(installname)libastyle31j.$(dylib) $(LDFLAGSr) -o $(bindir)/$@ $^
javadebug: libastylejd.$(dylib)
- $(INSTALL) -m 755 -d $(ipath)
- @$(INSTALL) -m 755 $(bindir)/astyle $(ipath)
+ $(INSTALL) -m 755 -d $(DESTDIR)$(ipath)
+ @$(INSTALL) -m 755 $(bindir)/astyle $(DESTDIR)$(ipath)
- @if [ -d $(SYSCONF_PATH)/html ]; then \
- rm -rf $(SYSCONF_PATH)/html; \
+ @if [ -d $(DESTDIR)$(SYSCONF_PATH)/html ]; then \
+ rm -rf $(DESTDIR)$(SYSCONF_PATH)/html; \
- $(INSTALL) -m 755 -d $(SYSCONF_PATH)
- @mkdir -p $(SYSCONF_PATH)/html;
+ $(INSTALL) -m 755 -d $(DESTDIR)$(SYSCONF_PATH)
+ @mkdir -p $(DESTDIR)$(SYSCONF_PATH)/html;
@for files in ../../doc/*.html ../../doc/*.css; \
- $(INSTALL) -m 644 "$$files" $(SYSCONF_PATH)/html; \
+ $(INSTALL) -m 644 "$$files" $(DESTDIR)$(SYSCONF_PATH)/html; \
+install-lib: static shared
+ $(INSTALL) -m 755 -d $(DESTDIR)$(prefix)/lib
+ $(INSTALL) $(bindir)/libastyle.a $(bindir)/libastyle31.$(dylib) $(DESTDIR)$(prefix)/lib
+ ln -s libastyle31$(dylib) $(DESTDIR)$(prefix)/lib/libastyle.$(dylib)