From be98d6b2c522faa9cb54bde42c434fd3bd896552 Mon Sep 17 00:00:00 2001 From: Ave Date: Sat, 5 Dec 2020 00:24:46 +0300 Subject: [PATCH] Improve makefile and readme --- Makefile | 14 ++++++++++++-- README.md | 14 ++++++++++---- 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index b53e58d..7d0de9a 100644 --- a/Makefile +++ b/Makefile @@ -4,10 +4,20 @@ LIBS = -lrlottie DEPS = lodepng.cpp TARGET = lfe +ifeq ($(PREFIX),) + PREFIX := /usr/local +endif + all: $(TARGET) $(TARGET): $(TARGET).cpp - $(CC) $(CFLAGS) -o $(TARGET) $(DEPS) $(TARGET).cpp $(LIBS) + $(CC) $(CFLAGS) -o $(TARGET) $(DEPS) $(TARGET).cpp $(LIBS) + +install: $(TARGET) + install -m 644 $(TARGET) $(DESTDIR)$(PREFIX)/bin/ + +uninstall: + rm -f $(DESTDIR)$(PREFIX)/bin/$(TARGET) clean: - $(RM) $(TARGET) + $(RM) $(TARGET) diff --git a/README.md b/README.md index 7146307..4a46797 100644 --- a/README.md +++ b/README.md @@ -6,21 +6,27 @@ Codebase is a mess. You've been warned. ## Deps -- https://github.com/Samsung/rlottie -> Don't forget to do make install +- https://github.com/Samsung/rlottie -> Don't forget to do make install (you'll likely want to go with the cmake route) - https://github.com/lvandeve/lodepng -> Already included here. Licensed Zlib. -## How to build +You'll also need g++. + +## How to build and install ```bash make ``` -You'll need g++. +To install: + +```bash +sudo make install +``` ## How to use ```bash -./lfe mylottieanimation.json 420x420 +lfe mylottieanimation.json 420x420 ``` This will extract all frames as PNG files in the working directory.