-
Notifications
You must be signed in to change notification settings - Fork 21
/
Makefile
executable file
·93 lines (72 loc) · 2.32 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
SHELL = /bin/bash
ifndef DEBIAN_PACKAGE_NAME
export DEBIAN_PACKAGE_NAME:=ulam
export MAGIC_DEBIAN_PACKAGE_VERSION:=
endif
$(info Building MFM for Debian package name: $(DEBIAN_PACKAGE_NAME))
# Find our PLATFORM
include config/Makeplatform.mk
PLATFORMS:=$(PLATFORM)
####
# Variables exported to submakes
export ULAM_CUSTOM_ELEMENTS
export PLATFORM
export BASEDIR=$(CURDIR)
.PHONY: $(PLATFORMS) all clean realclean tar
sim: PLATFORMS:=sim
all: $(PLATFORMS)
export MFM_VERSION_NUMBER
doc: FORCE
mkdir -p doc/ref
doxygen
clean: $(PLATFORMS)
realclean: $(PLATFORMS)
rm -f bin/*
rm -rf build/
rm -rf doc/ref
include config/Makeversion.mk
TAR_SWITCHES+=--exclude=tools --exclude=*~ --exclude=.git --exclude=doc/internal --exclude=spikes --exclude-backups
TAR_SWITCHES+=--exclude=*.o --exclude=*.d
TAR_SWITCHES+=--exclude=res/elements/demos/*.so --exclude=res/elements/demos/*.mfz
TAR_SWITCHES+=--exclude=build/*/*.a
TAR_SWITCHES+=--mtime="2008-01-02 12:34:56"
TAR_SWITCHES+=--owner=0 --group=0 --numeric-owner
tar: FORCE
make realclean
PWD=`pwd`;BASE=`basename $$PWD`;cd ..;tar cvzf mfm-$(MFM_VERSION_NUMBER).tgz $(TAR_SWITCHES) $$BASE
ifeq ($(PLATFORM),tile)
REGNUM:=0
SLOTNUM:=03
DESTDIR:=$(abspath ..)
TAG_PATH:=$(DESTDIR)/slot$(SLOTNUM)-install-tag.dat
cdmd: FORCE
@if [ ! "$(shell id -u)" = 0 ] ; then \
echo "You are not root, run 'make $@' as root please" ; \
exit 1 ; \
fi ; \
MPWD=`pwd`;BASE=`basename $$MPWD`; \
echo $$MPWD for $$BASE; \
pushd ..;tar cvzf $$BASE-built.tgz $(TAR_SWITCHES) $$BASE; \
cp -f $$BASE-built.tgz /home/debian/CDMSAVE/TGZS/; \
FN=`/home/t2/MFM/bin/mfzmake cdmake $(REGNUM) $(SLOTNUM) $$BASE $$BASE-built.tgz | \
perl -e "while(<>) {/'([^']+)'/ && print "'$$1}'`; \
if [ "x$$FN" = "x" ] ; then echo "Build failed" ; else \
echo -n "Got $$FN for $$BASE, tag = " ; \
perl -e '"'$$FN'" =~ /[^-]+-[^-]+-([[:xdigit:]]+)[.]/; print $$1' > $(TAG_PATH); \
cat $(TAG_PATH); \
echo -n ", size = " ; stat -c %s $$FN; \
echo "TO RELEASE:" ; \
echo " cp $(TAG_PATH) /cdm/tags ; cp $(DESTDIR)/$$FN /cdm/common"; \
fi; \
popd
restart: FORCE
pkill mfmt2
endif
identify: FORCE
@echo "MFMsim $(MFM_VERSION_NUMBER)"
include config/Makedebian.mk
include config/Makeulamfile.mk
# Pass each entry in PLATFORMS down as a target
$(PLATFORMS):
export MFM_TARGET=$@;$(MAKE) -C src $(MAKECMDGOALS)
.PHONY: FORCE