blob: a47c54ca0a5ac1b5daf67a8c17d42805eb5ad126 [file] [log] [blame]
#
# This makefile builds everything in the ./examples directory.
#
# To build:
# 1. modify examples/common.mak as necessary
# 2. cd to the directorty containing this file
# 2. (optionally) clean via "make clean"
# 3. build via "make"
#
include examples/common.mak
# Directory containing SimpliciTI*.zip
DOWNLOADS = $(CURDIR)/../../imports/downloads
SIMPL = SimpliciTI-CCE-1.1.0
SIMPL_ZIP := $(firstword $(wildcard $(SIMPL).zip $(DOWNLOADS)/$(SIMPL).zip))
all: $(SIMPL)/.patches
@echo making examples ...
$(XDCROOT)/xdc -PR examples/txn/targets
$(XDCROOT)/xdc -P examples/thirdparty/rxtx examples/local/rf
$(XDCROOT)/xdc -Pr examples
$(MAKE) -C examples/local/apps/make/logapp
@echo all done.
SimpliciTI-CCE-1.1.0/.patches: patches/$(SIMPL)/patches-$(HOSTOS).txt | SimpliciTI-CCE-1.1.0
@echo patching $(dir $@) sources ...
cd $(dir $@); patch -p1 -i ../$<
touch $@
SimpliciTI-1.0.6/.patches: patches/$(SIMPL)/patches-$(HOSTOS).txt | SimpliciTI-1.0.6
@echo patching $(dir $@) sources ...
cd $(dir $@)/Components/simpliciti; \
mv "Network applications" nwk_applications || true
cd $(dir $@); patch -p1 -i ../$<
touch $@
$(SIMPL): $(SIMPL_ZIP)
@echo creating $@ ...
test -d $@ || unzip -q $<
.PHONY: docs clean clean-ip
docs:
@echo generating package docs ...
$(XDCROOT)/xdc -P examples/txn/targets
$(XDCROOT)/xdc .interfaces -P examples/local/rf
$(XDCROOT)/xdc .interfaces -Pr examples
$(XDCROOT)/xs xdc.tools.cdoc -od:docs/html -s -Pr examples
@echo done.
@echo Open docs/html/index.html to view the generated docs.
clean:
- rm -rf docs/html
- $(XDCROOT)/xdc -k $@ -PR examples
- $(MAKE) -C examples/local/apps/make/logapp $@
clean-ip: clean
- rm -rf $(SIMPL)
ifeq (0,1)
#
# Rule to make the patch file
#
patches/$(SIMPL)/patches-$(HOSTOS).txt: $(SIMPL),orig
@echo creating patch file $@ ...
@rm -f $@
@LC_ALL=C TZ=UTC0 diff -Ncr $</Components $(SIMPL)/Components > $@ || true
$(SIMPL),orig: $(SIMPL_ZIP)
@echo creating $@ ...
mkdir tmp
unzip -q $< -d tmp && mv tmp/$(SIMPL) $@
rm -rf tmp
cd $@/Components/simpliciti; mv "Network applications" nwk_applications
#
# Rule to test the patch file
#
.PHONY: test-patch clean-patch
test-patch: $(SIMPL),orig patches/$(SIMPL)/patches-$(HOSTOS).txt
@echo patching $< ...
cd $<; patch --verbose -p1 -i ../patches/$(SIMPL)/patches-$(HOSTOS).txt
@echo checking ...
diff -r $</Components $(SIMPL)/Components
@echo done.
clean: clean-patch
clean-patch:
- rm -rf $(SIMPL),orig
endif