Add -rpath to linker flags pointing to install directory

This removes the need to have the intermediate shell script
that updates the LD_LIBRARY_PATH environment variable
This commit is contained in:
Kevin Sawicki
2012-08-22 17:49:29 -07:00
parent 08ae611ff8
commit 2d2ae3ec07
7 changed files with 39 additions and 32 deletions

View File

@@ -1,3 +1,5 @@
INSTALLDIR=/usr/share/atom
CXXFLAGS := -Werror \
-pthread \
-fno-exceptions \
@@ -36,6 +38,7 @@ LDFLAGS := -pthread \
-Wl,-O1 \
-Wl,--as-needed \
-Wl,--gc-sections \
-Wl,-rpath=$(INSTALLDIR)
LIBS := -lX11 \
-lgtk-x11-2.0 \
@@ -61,24 +64,23 @@ LIBS := -lX11 \
SOURCES=atom.cpp native_handler.cpp client_handler.cpp onig_regexp_extension.cpp io_utils.cpp
OBJECTS=$(SOURCES:.cpp=.o)
INSTALLDIR=/usr/local/atom
all:
g++ $(CXXFLAGS) -c $(SOURCES)
mkdir -p bin
cp chrome.pak bin/
cp -R locales bin/
cp atom.png bin/
g++ -o bin/atom $(OBJECTS) $(LDFLAGS) $(LIBS)
g++ -o atom $(OBJECTS) $(LDFLAGS) $(LIBS)
clean:
rm -rf bin *.o
rm -rf atom *.o
install:
mkdir -p $(INSTALLDIR)
cp -R bin $(INSTALLDIR)
cp -R lib $(INSTALLDIR)
cp atom $(INSTALLDIR)
cp -R atom $(INSTALLDIR)
cp chrome.pak $(INSTALLDIR)
cp -R locales $(INSTALLDIR)
cp atom.png $(INSTALLDIR)
cp lib/libcef.so $(INSTALLDIR)
cp lib/libcef_dll_wrapper.a $(INSTALLDIR)
cp -R ../src $(INSTALLDIR)
cp -R ../static $(INSTALLDIR)
cp -R ../vendor $(INSTALLDIR)