File: Makefile

package info (click to toggle)
magic 8.3.105%2Bds.1-1.1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, sid
  • size: 17,128 kB
  • sloc: ansic: 175,615; sh: 7,634; tcl: 4,536; lisp: 2,554; makefile: 946; cpp: 587; python: 389; csh: 148; awk: 140
file content (137 lines) | stat: -rw-r--r-- 3,867 bytes parent folder | download | duplicates (2)
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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
#
# rcsid $Header: /usr/cvsroot/magic-8.0/Makefile,v 1.1.1.1 2008/02/03 20:43:49 tim Exp $
#

MAGICDIR   = .
PROGRAMS   = magic
TECH       = scmos
LIBRARIES  = database utils extflat
MODULES    = bplane cmwind commands database dbwind debug drc extflat \
	     extract graphics netmenu plow resis select sim textio tiles \
	     utils windows wiring

MAKEFLAGS  =
INSTALL_CAD_DIRS = windows doc ${TECH}

-include defs.mak

all:	$(ALL_TARGET)

standard:
	${MAKE} mains

tcl:
	${MAKE} tcllibrary

force: clean all

defs.mak:
	@echo No \"defs.mak\" file found.  Run "configure" to make one.

config:
	${MAGICDIR}/configure

tcllibrary: database/database.h modules
	@echo --- making Tcl shared libraries
	for dir in ${PROGRAMS}; do \
		${MAKE} -C $$dir tcl-main || exit 1 ; done

mains: database/database.h modules libs
	@echo --- making main programs
	for dir in ${PROGRAMS}; do \
		${MAKE} -C $$dir main || exit 1 ; done

database/database.h: database/database.h.in
	@echo --- making header file database/database.h
	${SCRIPTS}/makedbh database/database.h.in database/database.h

modules: database/database.h depend
	@echo --- making modules
	for dir in ${MODULES} ${PROGRAMS}; do \
		${MAKE} -C $$dir module || exit 1 ; done

libs:
	@echo --- making libraries
	for dir in ${LIBRARIES}; do \
		${MAKE} -C $$dir lib || exit 1 ; done

depend:	database/database.h
	@echo --- making dependencies
	${RM} */Depend
	for dir in ${MODULES} ${UNUSED_MODULES} ${PROGRAMS}; do \
		${MAKE} -C $$dir depend || exit 1 ; done

install: $(INSTALL_TARGET)

install-magic:
	@echo --- installing executable to $(DESTDIR)${INSTALL_BINDIR}
	@echo --- installing runtime files to $(DESTDIR)${INSTALL_LIBDIR}
	@${MAKE} install-real 2>&1 >> install.log

install-real: install-dirs
	for dir in ${INSTALL_CAD_DIRS}; do \
		${MAKE} -C $$dir install || exit 1 ; done
	for dir in ${PROGRAMS}; do \
		${MAKE} -C $$dir install || exit 1 ; done

install-tcl-dirs:
	${MAGICDIR}/scripts/mkdirs $(DESTDIR)${INSTALL_BINDIR} \
	$(DESTDIR)${INSTALL_MANDIR} $(DESTDIR)${INSTALL_SYSDIR} \
	$(DESTDIR)${INSTALL_TCLDIR}

install-dirs:
	${MAGICDIR}/scripts/mkdirs $(DESTDIR)${INSTALL_BINDIR} \
	$(DESTDIR)${INSTALL_MANDIR} $(DESTDIR)${INSTALL_SYSDIR} \
	$(DESTDIR)${INSTALL_SCMDIR}

install-tcl:
	@echo --- installing executable to $(DESTDIR)${INSTALL_BINDIR}
	@echo --- installing runtime files to $(DESTDIR)${INSTALL_LIBDIR}
	@${MAKE} install-tcl-real 2>&1 >> install.log

install-tcl-real: install-tcl-dirs
	for dir in ${INSTALL_CAD_DIRS} ${PROGRAMS}; do \
		${MAKE} -C $$dir install-tcl || exit 1 ; done

clean:
	for dir in ${MODULES} ${PROGRAMS} ${TECH} ${UNUSED_MODULES}; do \
		(cd $$dir && ${MAKE} clean); done
	${RM} *.tmp */*.tmp *.sav */*.sav *.log TAGS tags

distclean:
	touch defs.mak
	@${MAKE} clean
	${RM} defs.mak old.defs.mak ${MAGICDIR}/scripts/defs.mak
	${RM} ${MAGICDIR}/scripts/default.conf
	${RM} ${MAGICDIR}/scripts/config.log ${MAGICDIR}/scripts/config.status
	${RM} scripts/magic.spec magic-`cat VERSION` magic-`cat VERSION`.tgz
	${RM} *.log */Depend

dist:
	${RM} scripts/magic.spec magic-`cat VERSION` magic-`cat VERSION`.tgz
	sed -e /@VERSION@/s%@VERSION@%`cat VERSION`% \
	    scripts/magic.spec.in > scripts/magic.spec
	ln -nsf . magic-`cat VERSION`
	tar zchvf magic-`cat VERSION`.tgz --exclude CVS \
	    --exclude magic-`cat VERSION`/magic-`cat VERSION` \
	    --exclude magic-`cat VERSION`/magic-`cat VERSION`.tgz \
	    magic-`cat VERSION`

clean-mains:
	for dir in ${PROGRAMS}; do \
		(cd $$dir && ${RM} $$dir); done

tags:
	${RM} tags
	find . ${MODULES} ${PROGRAMS} -name "*.[ch]" -maxdepth 1 | xargs ctags -o tags

TAGS:
	${RM} TAGS
	find . ${MODULES} ${PROGRAMS} -name "*.[ch]" -maxdepth 1 | xargs etags -o TAGS

setup-git:
	git config --local include.path ../.gitconfig
	git stash save
	rm .git/index
	git checkout HEAD -- "$$(git rev-parse --show-toplevel)"
	git stash pop