1
General / Simplest way to distribute on Linux
« on: February 08, 2012, 03:03:25 am »
I've got it working now, for anybody who wants to distribute his code with the libraries in linux, here's how I did it.
My file hierarchy is as follows:
- lib/ >> here goes all the sfml libraries (.so files)
- Makefile
- src/
--- myfiles.h, myfiles.cpp
--- SFML/ >> here goes all the sfml headers
My very simple Makefile looks like:
The -Wl,-rpath,$(LIBDIR) make the executable use the libraries on your local folder.
My file hierarchy is as follows:
- lib/ >> here goes all the sfml libraries (.so files)
- Makefile
- src/
--- myfiles.h, myfiles.cpp
--- SFML/ >> here goes all the sfml headers
My very simple Makefile looks like:
Code: [Select]
EJECUTABLE = app
MODULOS = src/module1.o src/module2.o ...
CXX = g++
LIBDIR = ./lib
INCDIR = ./src
LIBS = -lsfml-window -lsfml-system -lother-libraries-here
LDFLAGS = -L$(LIBDIR)
CXXFLAGS = -I$(INCDIR) -Wl,-rpath,$(LIBDIR)
$(EJECUTABLE): $(MODULOS)
$(CXX) $(CXXFLAGS) -o $(EJECUTABLE) $(LDFLAGS) $(MODULOS) $(LIBS)
clean:
rm -f $(MODULOS) $(EJECUTABLE)
The -Wl,-rpath,$(LIBDIR) make the executable use the libraries on your local folder.