diff --git Makefile Makefile
index 5f4e414..c5b33f5 100644
--- a/Makefile
+++ b/Makefile
@@ -1,10 +1,10 @@
-CFLAGS=-pipe -mfloat-abi=hard -mcpu=arm1176jzf-s -fomit-frame-pointer -mabi=aapcs-linux -mtune=arm1176jzf-s -mfpu=vfp -Wno-psabi -mno-apcs-stack-check -g -mstructure-size-boundary=32 -mno-sched-prolog
+CFLAGS=-fomit-frame-pointer -mtune=arm1176jzf-s
 CFLAGS+=-std=c++0x -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS -DTARGET_POSIX -DTARGET_LINUX -fPIC -DPIC -D_REENTRANT -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -DHAVE_CMAKE_CONFIG -D__VIDEOCORE4__ -U_FORTIFY_SOURCE -Wall -DHAVE_OMXLIB -DUSE_EXTERNAL_FFMPEG  -DHAVE_LIBAVCODEC_AVCODEC_H -DHAVE_LIBAVUTIL_OPT_H -DHAVE_LIBAVUTIL_MEM_H -DHAVE_LIBAVUTIL_AVUTIL_H -DHAVE_LIBAVFORMAT_AVFORMAT_H -DHAVE_LIBAVFILTER_AVFILTER_H -DHAVE_LIBSWRESAMPLE_SWRESAMPLE_H -DOMX -DOMX_SKIP64BIT -ftree-vectorize -DUSE_EXTERNAL_OMX -DTARGET_RASPBERRY_PI -DUSE_EXTERNAL_LIBBCM_HOST
 
-LDFLAGS=-L$(SDKSTAGE)/opt/vc/lib/
-LDFLAGS+=-L./ -Lffmpeg_compiled/usr/local/lib/ -lc -lbrcmGLESv2 -lbrcmEGL -lbcm_host -lopenmaxil -lfreetype -lz -lasound
+LDFLAGS=-L$(XBPS_CROSS_BASE)/opt/vc/lib/ -Wl,-R/opt/vc/lib
+LDFLAGS+=-lc -lbrcmGLESv2 -lbrcmEGL -lbcm_host -lopenmaxil -lfreetype -lz -lasound
 
-INCLUDES+=-I./ -Ilinux -Iffmpeg_compiled/usr/local/include/ -I /usr/include/dbus-1.0 -I /usr/lib/arm-linux-gnueabihf/dbus-1.0/include -I/usr/include/freetype2 -isystem$(SDKSTAGE)/opt/vc/include -isystem$(SDKSTAGE)/opt/vc/include/interface/vcos/pthreads
+INCLUDES+=-I./ -Ilinux -I$(XBPS_CROSS_BASE)/usr/include/dbus-1.0 -I $(XBPS_CROSS_BASE)/usr/lib/dbus-1.0/include -I$(XBPS_CROSS_BASE)/usr/include/freetype2 -I$(XBPS_CROSS_BASE)/opt/vc/include -I$(XBPS_CROSS_BASE)/opt/vc/include/interface/vcos/pthreads
 
 DIST ?= omxplayer-dist
 STRIP ?= strip
@@ -41,7 +41,7 @@ SRC=		linux/XMemUtils.cpp \
 
 OBJS+=$(filter %.o,$(SRC:.cpp=.o))
 
-all: dist
+all: omxplayer.bin omxplayer.1
 
 %.o: %.cpp
 	@rm -f $@ 
@@ -53,7 +53,7 @@ version:
 	bash gen_version.sh > version.h 
 
 omxplayer.bin: version $(OBJS)
-	$(CXX) $(LDFLAGS) -o omxplayer.bin $(OBJS) -lvchiq_arm -lvchostif -lvcos -ldbus-1 -lrt -lpthread -lavutil -lavcodec -lavformat -lswscale -lswresample -lpcre
+	$(CXX) -o omxplayer.bin $(OBJS) $(LDFLAGS) -lvchiq_arm -lvchostif -lvcos -ldbus-1 -lrt -lpthread -lavutil -lavcodec -lavformat -lswscale -lswresample -lpcre
 	$(STRIP) omxplayer.bin
 
 help.h: README.md Makefile
@@ -94,7 +94,14 @@ dist: omxplayer.bin omxplayer.1
 	cd $(DIST); tar -czf ../$(DIST).tgz *
 
 install:
-	cp -r $(DIST)/* /
+	install -d $(DESTDIR)/usr/bin
+	install -d $(DESTDIR)/usr/share/doc/omxplayer
+	install -d $(DESTDIR)/usr/share/man/man1
+	install -m755 omxplayer $(DESTDIR)/usr/bin/omxplayer-dbus
+	install -m755 omxplayer.bin $(DESTDIR)/usr/bin/omxplayer
+	install -m644 omxplayer.1 $(DESTDIR)/usr/share/man/man1/
+	install -m644 README.md $(DESTDIR)/usr/share/doc/omxplayer/
+	install -m644 COPYING $(DESTDIR)/usr/share/doc/omxplayer/
 
 uninstall:
 	rm -rf /usr/bin/omxplayer
