2017-04-25 14:41:48 +02:00
|
|
|
#
|
|
|
|
|
# rcsid $Header: /usr/cvsroot/magic-8.0/Makefile,v 1.1.1.1 2008/02/03 20:43:49 tim Exp $
|
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
MAGICDIR = .
|
|
|
|
|
PROGRAMS = magic
|
2024-10-16 19:31:19 +02:00
|
|
|
TECHS = scmos
|
2017-04-25 14:41:48 +02:00
|
|
|
LIBRARIES = database utils extflat
|
2019-03-23 00:58:47 +01:00
|
|
|
MODULES = bplane cmwind commands database dbwind debug drc extflat \
|
|
|
|
|
extract graphics netmenu plow resis select sim textio tiles \
|
|
|
|
|
utils windows wiring
|
2017-04-25 14:41:48 +02:00
|
|
|
|
2024-10-17 22:15:30 +02:00
|
|
|
# This was `cat VERSION`
|
|
|
|
|
VERSION := $(shell cat ${MAGICDIR}/VERSION)
|
|
|
|
|
|
2017-04-25 14:41:48 +02:00
|
|
|
MAKEFLAGS =
|
2024-10-16 19:31:19 +02:00
|
|
|
INSTALL_CAD_DIRS = windows doc ${TECHS}
|
2017-04-25 14:41:48 +02:00
|
|
|
|
2020-02-24 23:30:18 +01:00
|
|
|
-include defs.mak
|
2017-04-25 14:41:48 +02:00
|
|
|
|
2024-10-16 19:31:19 +02:00
|
|
|
all: $(ALL_TARGET) techs
|
2017-04-25 14:41:48 +02:00
|
|
|
|
|
|
|
|
standard:
|
|
|
|
|
@echo --- errors and warnings logged in file make.log
|
2022-03-29 22:52:01 +02:00
|
|
|
@${MAKE} mains
|
2017-04-25 14:41:48 +02:00
|
|
|
|
|
|
|
|
tcl:
|
|
|
|
|
@echo --- errors and warnings logged in file make.log
|
2022-03-29 22:52:01 +02:00
|
|
|
@${MAKE} tcllibrary
|
2017-04-25 14:41:48 +02:00
|
|
|
|
|
|
|
|
force: clean all
|
|
|
|
|
|
|
|
|
|
defs.mak:
|
|
|
|
|
@echo No \"defs.mak\" file found. Run "configure" to make one.
|
2024-10-21 15:31:50 +02:00
|
|
|
@exit 1
|
2017-04-25 14:41:48 +02:00
|
|
|
|
|
|
|
|
config:
|
|
|
|
|
${MAGICDIR}/configure
|
|
|
|
|
|
|
|
|
|
tcllibrary: database/database.h modules
|
|
|
|
|
@echo --- making Tcl shared libraries
|
|
|
|
|
for dir in ${PROGRAMS}; do \
|
2022-03-29 22:52:01 +02:00
|
|
|
(cd $$dir && ${MAKE} tcl-main) || exit 1; done
|
2017-04-25 14:41:48 +02:00
|
|
|
|
|
|
|
|
mains: database/database.h modules libs
|
|
|
|
|
@echo --- making main programs
|
|
|
|
|
for dir in ${PROGRAMS}; do \
|
2022-03-29 22:52:01 +02:00
|
|
|
(cd $$dir && ${MAKE} main) || exit 1; done
|
2017-04-25 14:41:48 +02:00
|
|
|
|
2024-10-16 18:47:19 +02:00
|
|
|
database/database.h: ${MAGICDIR}/database/database.h.in
|
2017-04-25 14:41:48 +02:00
|
|
|
@echo --- making header file database/database.h
|
2024-10-16 18:47:19 +02:00
|
|
|
${SCRIPTS}/makedbh ${MAGICDIR}/database/database.h.in database/database.h
|
2017-04-25 14:41:48 +02:00
|
|
|
|
2019-07-14 18:07:38 +02:00
|
|
|
modules: database/database.h depend
|
2017-04-25 14:41:48 +02:00
|
|
|
@echo --- making modules
|
|
|
|
|
for dir in ${MODULES} ${PROGRAMS}; do \
|
2022-03-29 22:52:01 +02:00
|
|
|
(cd $$dir && ${MAKE} module) || exit 1; done
|
2017-04-25 14:41:48 +02:00
|
|
|
|
2024-10-21 15:31:50 +02:00
|
|
|
libs: database/database.h depend
|
2017-04-25 14:41:48 +02:00
|
|
|
@echo --- making libraries
|
|
|
|
|
for dir in ${LIBRARIES}; do \
|
2022-03-29 22:52:01 +02:00
|
|
|
(cd $$dir && ${MAKE} lib) || exit 1; done
|
2017-04-25 14:41:48 +02:00
|
|
|
|
2024-10-16 10:49:10 +02:00
|
|
|
#
|
|
|
|
|
# extcheck - utility tool
|
|
|
|
|
# net2ir - utility tool
|
|
|
|
|
# oa - disabled (needs 'clean' target renaming)
|
|
|
|
|
SUBDIRS = bplane cmwind commands database dbwind debug drc extflat extract graphics \
|
|
|
|
|
magic netmenu plow resis select sim textio tiles utils windows wiring
|
|
|
|
|
|
|
|
|
|
BUNDLED_MODULES = readline lisp
|
|
|
|
|
|
|
|
|
|
# Unique list of all subdir that might have Depend file, we have to deduplicate otherwise
|
|
|
|
|
# MAKE will warning loudly. This list is somewhat empty when defs.mak does not exist
|
|
|
|
|
SUBDIRS_FILTERED := $(shell echo ${MODULES} ${PROGRAMS} ${SUBDIRS} | tr ' ' '\n' | sort | uniq)
|
|
|
|
|
|
|
|
|
|
$(addsuffix /Depend, ${SUBDIRS_FILTERED}): database/database.h
|
2019-07-23 14:06:41 +02:00
|
|
|
@echo --- making dependencies
|
2024-10-16 10:49:10 +02:00
|
|
|
${MAKE} -C $(dir $@) depend
|
|
|
|
|
|
|
|
|
|
.PHONY: depend
|
|
|
|
|
depend: defs.mak $(addsuffix /Depend, ${SUBDIRS_FILTERED})
|
2017-04-25 14:41:48 +02:00
|
|
|
|
2024-10-16 19:31:19 +02:00
|
|
|
.PHONY: techs
|
|
|
|
|
techs: depend
|
|
|
|
|
@echo --- making techs
|
|
|
|
|
for dir in ${TECHS}; do \
|
|
|
|
|
(cd $$dir && ${MAKE} all) || exit 1; done
|
|
|
|
|
|
2017-04-25 14:41:48 +02:00
|
|
|
install: $(INSTALL_TARGET)
|
|
|
|
|
|
|
|
|
|
install-magic:
|
2020-01-28 18:17:22 +01:00
|
|
|
@echo --- installing executable to $(DESTDIR)${INSTALL_BINDIR}
|
|
|
|
|
@echo --- installing runtime files to $(DESTDIR)${INSTALL_LIBDIR}
|
2022-03-29 22:52:01 +02:00
|
|
|
@${MAKE} install-real
|
2017-04-25 14:41:48 +02:00
|
|
|
|
|
|
|
|
install-real: install-dirs
|
|
|
|
|
for dir in ${INSTALL_CAD_DIRS}; do \
|
|
|
|
|
(cd $$dir && ${MAKE} install); done
|
|
|
|
|
for dir in ${PROGRAMS}; do \
|
|
|
|
|
(cd $$dir && ${MAKE} install); done
|
|
|
|
|
|
|
|
|
|
install-tcl-dirs:
|
2020-01-28 19:10:31 +01:00
|
|
|
${MAGICDIR}/scripts/mkdirs $(DESTDIR)${INSTALL_BINDIR} \
|
|
|
|
|
$(DESTDIR)${INSTALL_MANDIR} $(DESTDIR)${INSTALL_SYSDIR} \
|
|
|
|
|
$(DESTDIR)${INSTALL_TCLDIR} $(DESTDIR)${INSTALL_TCLDIR}/bitmaps
|
2017-04-25 14:41:48 +02:00
|
|
|
|
|
|
|
|
install-dirs:
|
2020-01-28 19:10:31 +01:00
|
|
|
${MAGICDIR}/scripts/mkdirs $(DESTDIR)${INSTALL_BINDIR} \
|
|
|
|
|
$(DESTDIR)${INSTALL_MANDIR} $(DESTDIR)${INSTALL_SYSDIR} \
|
|
|
|
|
$(DESTDIR)${INSTALL_SCMDIR}
|
2017-04-25 14:41:48 +02:00
|
|
|
|
|
|
|
|
install-tcl:
|
2020-01-28 18:17:22 +01:00
|
|
|
@echo --- installing executable to $(DESTDIR)${INSTALL_BINDIR}
|
|
|
|
|
@echo --- installing runtime files to $(DESTDIR)${INSTALL_LIBDIR}
|
2022-03-29 22:52:01 +02:00
|
|
|
@${MAKE} install-tcl-real
|
2017-04-25 14:41:48 +02:00
|
|
|
|
|
|
|
|
install-tcl-real: install-tcl-dirs
|
|
|
|
|
for dir in ${INSTALL_CAD_DIRS} ${PROGRAMS}; do \
|
|
|
|
|
(cd $$dir && ${MAKE} install-tcl); done
|
|
|
|
|
|
|
|
|
|
clean:
|
2024-10-16 10:49:10 +02:00
|
|
|
for dir in ${SUBDIRS_FILTERED} ${TECHS} ${BUNDLED_MODULES}; do \
|
2017-04-25 14:41:48 +02:00
|
|
|
(cd $$dir && ${MAKE} clean); done
|
2020-10-15 23:31:20 +02:00
|
|
|
${RM} *.tmp */*.tmp *.sav */*.sav *.log TAGS tags
|
2017-04-25 14:41:48 +02:00
|
|
|
|
|
|
|
|
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
|
2024-10-16 18:47:19 +02:00
|
|
|
${RM} database/database.h
|
2024-10-17 22:15:30 +02:00
|
|
|
${RM} scripts/magic.spec magic-${VERSION} magic-${VERSION}.tgz
|
2024-10-16 10:49:10 +02:00
|
|
|
${RM} *.log
|
2017-04-25 14:41:48 +02:00
|
|
|
|
|
|
|
|
dist:
|
2024-10-17 22:15:30 +02:00
|
|
|
${RM} scripts/magic.spec magic-${VERSION} magic-${VERSION}.tgz
|
|
|
|
|
sed -e /@VERSION@/s%@VERSION@%${VERSION}% \
|
2017-04-25 14:41:48 +02:00
|
|
|
scripts/magic.spec.in > scripts/magic.spec
|
2025-01-08 09:58:55 +01:00
|
|
|
${LN} -nsf . magic-${VERSION}
|
2024-10-17 22:15:30 +02:00
|
|
|
tar zchvf magic-${VERSION}.tgz --exclude CVS \
|
|
|
|
|
--exclude magic-${VERSION}/magic-${VERSION} \
|
|
|
|
|
--exclude magic-${VERSION}/magic-${VERSION}.tgz \
|
|
|
|
|
magic-${VERSION}
|
2017-04-25 14:41:48 +02:00
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
2020-05-23 01:00:05 +02:00
|
|
|
TAGS:
|
2017-04-25 14:41:48 +02:00
|
|
|
${RM} TAGS
|
|
|
|
|
find . ${MODULES} ${PROGRAMS} -name "*.[ch]" -maxdepth 1 | xargs etags -o TAGS
|
2020-05-23 01:00:05 +02:00
|
|
|
|
2020-05-23 23:01:30 +02:00
|
|
|
setup-git:
|
|
|
|
|
git config --local include.path ../.gitconfig
|
|
|
|
|
git stash save
|
2025-01-08 10:01:47 +01:00
|
|
|
${RM} .git/index
|
2020-05-23 23:01:30 +02:00
|
|
|
git checkout HEAD -- "$$(git rev-parse --show-toplevel)"
|
|
|
|
|
git stash pop
|