2024-10-23 12:12:30 +03:00
|
|
|
# Normalise OUTDIR to avoid triggering rebuilds
|
|
|
|
override OUTDIR := $(patsubst ./%,%,$(OUTDIR))
|
|
|
|
|
|
|
|
VPATH = $(top_rulesdir)/$(OUTDIR) $(top_srcdir)/$(OUTDIR)
|
|
|
|
|
|
|
|
SHELL = /bin/sh -e
|
|
|
|
|
|
|
|
CC = $(CROSS_COMPILE)gcc
|
|
|
|
CXX = $(CROSS_COMPILE)g++
|
|
|
|
PKG_CONFIG = $(CROSS_COMPILE)pkg-config
|
|
|
|
CFLAGS := $(shell dpkg-buildflags --get CFLAGS) -Wall
|
|
|
|
CPPFLAGS := $(shell dpkg-buildflags --get CPPFLAGS) \
|
2024-10-29 05:12:06 +03:00
|
|
|
-I$(top_srcdir)/$(OUTDIR) \
|
|
|
|
-I$(top_srcdir)/debian/build/build-tools/$(OUTDIR) \
|
|
|
|
-I$(top_srcdir)/scripts/include \
|
|
|
|
-isystem $(top_srcdir)/debian/build/build-tools/include
|
2024-10-23 12:12:30 +03:00
|
|
|
CXXFLAGS := $(shell dpkg-buildflags --get CXXFLAGS) -Wall
|
|
|
|
LDFLAGS := $(shell dpkg-buildflags --get LDFLAGS)
|
|
|
|
|
|
|
|
installdir ?= $(prefix)/$(OUTDIR)
|
|
|
|
|
|
|
|
all: all-local all-recursive
|
|
|
|
clean: clean-recursive
|
|
|
|
install: install-local install-recursive
|
|
|
|
|
|
|
|
%-recursive:
|
2024-10-29 05:12:06 +03:00
|
|
|
+@list='$(SUBDIRS)' ; \
|
|
|
|
for i in $$list ; do \
|
|
|
|
echo "Making $* in $$i" ; \
|
|
|
|
mkdir -p "$$i" ; \
|
|
|
|
$(MAKE) -C "$$i" \
|
|
|
|
-f $(top_rulesdir)/$(OUTDIR)/$$i/Makefile \
|
|
|
|
OUTDIR=$(OUTDIR)/$$i \
|
|
|
|
$* ; \
|
2024-10-23 12:12:30 +03:00
|
|
|
done
|
|
|
|
|
|
|
|
all-local: $(PROGS)
|
|
|
|
|
|
|
|
install-local: install-local-progs install-local-scripts install-local-data
|
|
|
|
|
|
|
|
install-local-progs: $(PROGS)
|
2024-10-29 05:12:06 +03:00
|
|
|
@for p in $^ ; do \
|
|
|
|
echo " install -m755 '$$p' '$(DESTDIR)/$(installdir)'" ; \
|
|
|
|
install -D -m755 "$$p" "$(DESTDIR)/$(installdir)/$$(basename "$$p")" ; \
|
2024-10-23 12:12:30 +03:00
|
|
|
done
|
|
|
|
|
|
|
|
SCRIPTS_REAL = $(wildcard $(addprefix $(top_srcdir)/$(OUTDIR)/,$(SCRIPTS)))
|
|
|
|
|
|
|
|
install-local-scripts: $(SCRIPTS_REAL)
|
2024-10-29 05:12:06 +03:00
|
|
|
@for p in $^ ; do \
|
|
|
|
echo " install -m755 '$$p' '$(DESTDIR)/$(installdir)'" ; \
|
|
|
|
install -D -m755 \
|
|
|
|
-s --strip-program $(top_srcdir)/debian/bin/fix-shebang \
|
|
|
|
"$$p" "$(DESTDIR)/$(installdir)/$$(basename "$$p")" ; \
|
2024-10-23 12:12:30 +03:00
|
|
|
done
|
|
|
|
|
|
|
|
DATA_REAL = $(wildcard $(addprefix $(top_srcdir)/$(OUTDIR)/,$(DATA)))
|
|
|
|
|
|
|
|
install-local-data: $(DATA_REAL)
|
2024-10-29 05:12:06 +03:00
|
|
|
@for p in $^ ; do \
|
|
|
|
echo " install -m644 '$$p' '$(DESTDIR)/$(installdir)'" ; \
|
|
|
|
install -D -m644 "$$p" "$(DESTDIR)/$(installdir)/$$(basename "$$p")" ; \
|
2024-10-23 12:12:30 +03:00
|
|
|
done
|
|
|
|
|