mirror of
https://github.com/wiiu-env/wut.git
synced 2024-12-05 03:04:16 +01:00
Add support for specifying install directory with "make install DESTDIR=x"
This commit is contained in:
parent
ee47d6da6b
commit
e4c91162d4
8
Makefile
8
Makefile
@ -6,7 +6,11 @@ endif
|
||||
|
||||
TARGETS := tools crt rpl
|
||||
|
||||
DESTDIR ?= $(CURDIR)
|
||||
INSTALLDIR := $(shell cd ${DESTDIR} ; pwd)
|
||||
|
||||
export WUT_ROOT
|
||||
export INSTALLDIR
|
||||
|
||||
all:
|
||||
@for dir in $(TARGETS); do \
|
||||
@ -26,8 +30,8 @@ clean:
|
||||
done
|
||||
|
||||
install:
|
||||
@mkdir -p bin
|
||||
@mkdir -p lib
|
||||
@mkdir -p $(INSTALLDIR)
|
||||
@cp -r include $(INSTALLDIR)
|
||||
@for dir in $(TARGETS); do \
|
||||
echo; \
|
||||
echo Installing $$dir; \
|
||||
|
@ -12,8 +12,8 @@ clean:
|
||||
@rm -f $(OFILES) $(OUTPUT).a
|
||||
|
||||
install: all
|
||||
@mkdir -p $(WUT_ROOT)/lib
|
||||
@cp -f *.a $(WUT_ROOT)/lib
|
||||
@mkdir -p $(INSTALLDIR)/lib
|
||||
@cp -f *.a $(INSTALLDIR)/lib
|
||||
|
||||
%.o: %.S
|
||||
@echo "[CC] $(notdir $<)"
|
||||
|
@ -15,10 +15,10 @@ clean:
|
||||
done
|
||||
|
||||
install: all
|
||||
@mkdir -p $(WUT_ROOT)/lib
|
||||
@mkdir -p $(INSTALLDIR)/lib
|
||||
@for dir in $(TARGETS); do \
|
||||
echo Installing $$dir; \
|
||||
cp $$dir/*.a $(WUT_ROOT)/lib; \
|
||||
cp $$dir/*.a $(INSTALLDIR)/lib; \
|
||||
done
|
||||
|
||||
.PHONY: all install clean
|
||||
|
@ -18,10 +18,10 @@ else
|
||||
endif
|
||||
|
||||
install: all
|
||||
@mkdir -p $(WUT_ROOT)/bin
|
||||
@mkdir -p $(INSTALLDIR)/bin
|
||||
@for dir in $(TARGETS); do \
|
||||
echo Installing $$dir; \
|
||||
cp bin/$$dir $(WUT_ROOT)/bin; \
|
||||
cp bin/$$dir $(INSTALLDIR)/bin; \
|
||||
done
|
||||
|
||||
else
|
||||
@ -40,10 +40,10 @@ clean:
|
||||
done
|
||||
|
||||
install: all
|
||||
@mkdir -p $(WUT_ROOT)/bin
|
||||
@mkdir -p $(INSTALLDIR)/bin
|
||||
@for dir in $(TARGETS); do \
|
||||
echo Installing $$dir; \
|
||||
cp $$dir/$$dir $(WUT_ROOT)/bin; \
|
||||
cp $$dir/$$dir $(INSTALLDIR)/bin; \
|
||||
done
|
||||
endif
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user