Add install and debug to Makefile

Signed-off-by: Mahyar Koshkouei <mahyar.koshkouei@gmail.com>
This commit is contained in:
Mahyar Koshkouei 2018-01-13 09:41:52 +00:00
parent ffeec1a197
commit 1450694edb
1 changed files with 28 additions and 14 deletions

View File

@ -1,6 +1,10 @@
STATIC_LINKING := 0
AR := ar
DEBUG := 1
DEBUG := 0
TARGET_NAME := mpv
PREFIX := /usr
LIBDIR := $(PREFIX)/lib
LIBRETRO_DIR := libretro
ifeq ($(platform),)
platform = unix
@ -25,8 +29,6 @@ else ifneq (,$(findstring rpi3,$(platform)))
override platform += unix
endif
TARGET_NAME := mpv
ifeq ($(ARCHFLAGS),)
ifeq ($(archs),ppc)
ARCHFLAGS = -arch ppc -arch ppc64
@ -88,19 +90,10 @@ else ifeq ($(platform), vita)
else
CC = gcc
TARGET := $(TARGET_NAME)_libretro.dll
SHARED := -shared -static-libgcc -static-libstdc++ -s -Wl,--version-script=link.T -Wl,--no-undefined
SHARED := -shared -static-libgcc -static-libstdc++ \
-Wl,--version-script=link.T -Wl,--no-undefined
endif
ifeq ($(DEBUG), 1)
CFLAGS += -O0 -g
else
CFLAGS += -Ofast -s
endif
OBJECTS := mpv-libretro.o
LDFLAGS += -lmpv
CFLAGS += -Wall -pedantic $(fpic)
ifneq (,$(findstring gles,$(platform)))
CFLAGS += -DHAVE_OPENGLES
endif
@ -111,6 +104,18 @@ else
CFLAGS += -std=gnu99
endif
# Always have some debugging information.
CFLAGS += -g
ifeq ($(DEBUG), 1)
CFLAGS += -Og
else
CFLAGS += -Ofast
endif
OBJECTS := mpv-libretro.o
LDFLAGS += -lmpv
CFLAGS += -Wall -pedantic $(fpic)
all: $(TARGET)
$(TARGET): $(OBJECTS)
@ -126,4 +131,13 @@ endif
clean:
rm -f $(OBJECTS) $(TARGET)
install:
install -D -m 755 $(TARGET) $(DESTDIR)$(LIBDIR)/$(LIBRETRO_DIR)/$(TARGET)
install-snip:
install -D -s -m 755 $(TARGET) $(DESTDIR)$(LIBDIR)/$(LIBRETRO_DIR)/$(TARGET)
uninstall:
rm $(DESTDIR)$(LIBDIR)/$(LIBRETRO_DIR)/$(TARGET)
.PHONY: clean