Merge pull request #542 from VorpalBlade/features/install

Add install rule and fix some build system issues
This commit is contained in:
David Given
2022-06-21 20:55:45 +02:00
committed by GitHub
2 changed files with 19 additions and 8 deletions

5
.gitignore vendored
View File

@@ -2,8 +2,9 @@
.project
/.ninja*
/brother120tool
/brother240tool
/fluxengine
/brother120tool-*
/brother240tool
/brother240tool-*
/fluxengine
/fluxengine-*
/upgrade-flux-file

View File

@@ -35,9 +35,9 @@ endif
OBJDIR ?= .obj
CCPREFIX ?=
LUA ?= lua
CC = $(CCPREFIX)gcc
CXX = $(CCPREFIX)g++
AR = $(CCPREFIX)ar
CC ?= $(CCPREFIX)gcc
CXX ?= $(CCPREFIX)g++
AR ?= $(CCPREFIX)ar
PKG_CONFIG ?= pkg-config
WX_CONFIG ?= wx-config
PROTOC ?= protoc
@@ -46,7 +46,10 @@ CXXFLAGS += -std=c++17
LDFLAGS ?=
PLATFORM ?= UNIX
TESTS ?= yes
EXT ?=
EXT ?=
DESTDIR ?=
PREFIX ?= /usr/local
BINDIR ?= $(PREFIX)/bin
CFLAGS += \
-Iarch \
@@ -84,7 +87,7 @@ $(1): private LDFLAGS += $(shell $(PKG_CONFIG) --libs $(3))
$(2): private CFLAGS += $(shell $(PKG_CONFIG) --cflags $(3))
endef
.PHONY: all tests
.PHONY: all binaries tests clean install install-bin
all: binaries tests
PROTOS = \
@@ -221,5 +224,12 @@ $(OBJDIR)/%.pb.h: %.proto
clean:
rm -rf $(OBJDIR)
-include $(OBJS:%.o=%.d)
install: install-bin # install-man install-docs ...
install-bin: fluxengine$(EXT) fluxengine-gui$(EXT) brother120tool$(EXT) brother240tool$(EXT) upgrade-flux-file$(EXT)
install -d "$(DESTDIR)$(BINDIR)"
for target in $^; do \
install $$target "$(DESTDIR)$(BINDIR)/$$target"; \
done
-include $(OBJS:%.o=%.d)