Handle cross stripped binary
Signed-off-by: Adrien Gallouët <adrien@gallouet.fr>
This commit is contained in:
16
Makefile
16
Makefile
@@ -3,7 +3,6 @@ VERSION := $(shell ./version.sh)
|
|||||||
DIST := $(NAME)-$(VERSION)
|
DIST := $(NAME)-$(VERSION)
|
||||||
|
|
||||||
CC ?= cc
|
CC ?= cc
|
||||||
DESTDIR ?=
|
|
||||||
prefix ?= /usr
|
prefix ?= /usr
|
||||||
Q := @
|
Q := @
|
||||||
|
|
||||||
@@ -18,15 +17,22 @@ FLAGS += -L.static/$(CROSS)/libsodium-stable/src/libsodium/.libs
|
|||||||
SRC := argz/argz.c mud/mud.c mud/aegis256/aegis256.c $(wildcard src/*.c)
|
SRC := argz/argz.c mud/mud.c mud/aegis256/aegis256.c $(wildcard src/*.c)
|
||||||
HDR := argz/argz.h mud/mud.h mud/aegis256/aegis256.h $(wildcard src/*.h)
|
HDR := argz/argz.h mud/mud.h mud/aegis256/aegis256.h $(wildcard src/*.h)
|
||||||
|
|
||||||
|
ifneq ($(CROSS),)
|
||||||
|
X = $(CROSS)-
|
||||||
|
endif
|
||||||
|
|
||||||
$(NAME): $(SRC) $(HDR)
|
$(NAME): $(SRC) $(HDR)
|
||||||
@echo "$(NAME)"
|
$(Q)$(X)$(CC) $(FLAGS) -o $(NAME) $(SRC) -lsodium
|
||||||
$(Q)$(CC) $(FLAGS) -o $(NAME) $(SRC) -lsodium
|
|
||||||
|
$(NAME)-strip: $(NAME)
|
||||||
|
$(Q)cp $< $@
|
||||||
|
$(Q)$(X)strip -s $@
|
||||||
|
|
||||||
.PHONY: install
|
.PHONY: install
|
||||||
install: $(NAME)
|
install: $(NAME)-strip
|
||||||
@echo "$(DESTDIR)$(prefix)/bin/$(NAME)"
|
@echo "$(DESTDIR)$(prefix)/bin/$(NAME)"
|
||||||
$(Q)install -m 755 -d $(DESTDIR)$(prefix)/bin
|
$(Q)install -m 755 -d $(DESTDIR)$(prefix)/bin
|
||||||
$(Q)install -m 755 -s $(NAME) $(DESTDIR)$(prefix)/bin
|
$(Q)install -m 755 $(NAME)-strip $(DESTDIR)$(prefix)/bin/$(NAME)
|
||||||
|
|
||||||
.PHONY: clean
|
.PHONY: clean
|
||||||
clean:
|
clean:
|
||||||
|
|||||||
Reference in New Issue
Block a user