Add install and debug to Makefile
Signed-off-by: Mahyar Koshkouei <mahyar.koshkouei@gmail.com>
This commit is contained in:
parent
ffeec1a197
commit
1450694edb
42
Makefile
42
Makefile
|
@ -1,6 +1,10 @@
|
||||||
STATIC_LINKING := 0
|
STATIC_LINKING := 0
|
||||||
AR := ar
|
AR := ar
|
||||||
DEBUG := 1
|
DEBUG := 0
|
||||||
|
TARGET_NAME := mpv
|
||||||
|
PREFIX := /usr
|
||||||
|
LIBDIR := $(PREFIX)/lib
|
||||||
|
LIBRETRO_DIR := libretro
|
||||||
|
|
||||||
ifeq ($(platform),)
|
ifeq ($(platform),)
|
||||||
platform = unix
|
platform = unix
|
||||||
|
@ -25,8 +29,6 @@ else ifneq (,$(findstring rpi3,$(platform)))
|
||||||
override platform += unix
|
override platform += unix
|
||||||
endif
|
endif
|
||||||
|
|
||||||
TARGET_NAME := mpv
|
|
||||||
|
|
||||||
ifeq ($(ARCHFLAGS),)
|
ifeq ($(ARCHFLAGS),)
|
||||||
ifeq ($(archs),ppc)
|
ifeq ($(archs),ppc)
|
||||||
ARCHFLAGS = -arch ppc -arch ppc64
|
ARCHFLAGS = -arch ppc -arch ppc64
|
||||||
|
@ -88,19 +90,10 @@ else ifeq ($(platform), vita)
|
||||||
else
|
else
|
||||||
CC = gcc
|
CC = gcc
|
||||||
TARGET := $(TARGET_NAME)_libretro.dll
|
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
|
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)))
|
ifneq (,$(findstring gles,$(platform)))
|
||||||
CFLAGS += -DHAVE_OPENGLES
|
CFLAGS += -DHAVE_OPENGLES
|
||||||
endif
|
endif
|
||||||
|
@ -111,6 +104,18 @@ else
|
||||||
CFLAGS += -std=gnu99
|
CFLAGS += -std=gnu99
|
||||||
endif
|
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)
|
all: $(TARGET)
|
||||||
|
|
||||||
$(TARGET): $(OBJECTS)
|
$(TARGET): $(OBJECTS)
|
||||||
|
@ -126,4 +131,13 @@ endif
|
||||||
clean:
|
clean:
|
||||||
rm -f $(OBJECTS) $(TARGET)
|
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
|
.PHONY: clean
|
||||||
|
|
Loading…
Reference in New Issue