blob: cb4286b08fa32ad54fd7974174bd5d3a3c56a421 [file] [log] [blame]
Tim Edwards55f4d0e2020-07-05 15:41:02 -04001#---------------------------------------------------
2# Makefile for efabless project open_pdks
3# Tim Edwards, 11/21/2016
4# Updated 10/19/2018 for use independently of the
5# efabless /ef/ tree filesystem setup.
6# Updated 5/5/2020 for use with the 2-stage install
7#---------------------------------------------------
8#
9# Typical usage:
10#
11# make
12# generates the tech files from source masters.
13#
Tim Edwards7cbaaba2020-08-05 12:19:18 -040014# make install
Tim Edwards55f4d0e2020-07-05 15:41:02 -040015#
Tim Edwards7cbaaba2020-08-05 12:19:18 -040016# installs the tech files. If the configuration
17# script has been given the "--with-<PDK>-dist-path="
18# option, then tech files are installed in the path
19# (such as a git repository) that is used for
20# distribution of software across a system. Otherwise,
21# files are installed in the local path specified by
22# the configuration option "--with-<PDK>-local-path=".
Tim Edwards55f4d0e2020-07-05 15:41:02 -040023#
24# make clean
25#
26# clean up all files generated by 'make'
27#
Tim Edwards7cbaaba2020-08-05 12:19:18 -040028# make veryclean
29#
30# clean up all files generated by 'make' and remove
31# all log files.
32#
Tim Edwards8830dfe2021-02-25 11:29:59 -050033# make uninstall
34#
35# remove the installed PDKs.
36#
Tim Edwards55f4d0e2020-07-05 15:41:02 -040037#---------------------------------------------------
38#
39# The following definitions are tied to the contents
40# of this repository and should not be changed.
41
Tim Edwards8292c902020-12-24 16:25:25 -050042TECHS =
43
44SKY130_SOURCE_PATH = @SKY130_SOURCE_PATH@
45ifneq ($(SKY130_SOURCE_PATH),)
46 TECHS += sky130
47endif
48
49DONE_MESSAGE = "Done."
50ifeq ($(TECHS),)
51 DONE_MESSAGE = "No techs configured."
52endif
53
54TECHS_ALL = $(addprefix tech_,$(TECHS))
55TECHS_INSTALL = $(addprefix install-,$(TECHS))
Tim Edwards8830dfe2021-02-25 11:29:59 -050056TECHS_UNINSTALL = $(addprefix uninstall-,$(TECHS))
Tim Edwards8292c902020-12-24 16:25:25 -050057TECHS_CLEAN = $(addprefix clean-,$(TECHS))
58TECHS_VERYCLEAN = $(addprefix veryclean-,$(TECHS))
Tim Edwards55f4d0e2020-07-05 15:41:02 -040059
60#---------------------------------------------------
61
Tim Edwards8292c902020-12-24 16:25:25 -050062all: $(TECHS_ALL)
63 @echo $(DONE_MESSAGE)
64
Tim Edwards053cff32021-03-13 17:17:36 -050065install: $(TECHS_INSTALL) common_install
Tim Edwards8292c902020-12-24 16:25:25 -050066 @echo $(DONE_MESSAGE)
67
Tim Edwards8830dfe2021-02-25 11:29:59 -050068uninstall: $(TECHS_UNINSTALL)
69 @echo $(DONE_MESSAGE)
70
Tim Edwards8292c902020-12-24 16:25:25 -050071clean: $(TECHS_CLEAN)
72 @echo $(DONE_MESSAGE)
73
74veryclean: $(TECHS_VERYCLEAN)
75 @echo $(DONE_MESSAGE)
76
77distclean: $(TECHS_VERYCLEAN)
Tim Edwards6ee11532021-02-11 12:29:33 -050078 ${RM} -rf sources
Tim Edwards8292c902020-12-24 16:25:25 -050079 @echo $(DONE_MESSAGE)
Tim Edwards55f4d0e2020-07-05 15:41:02 -040080
81#---------------------------------------------------
82
Tim Edwards10aa9ab2021-03-15 17:46:29 -040083CPP = common/preproc.py
84
Tim Edwards053cff32021-03-13 17:17:36 -050085common_install:
Tim Edwardscdfec5e2021-04-22 20:59:13 -040086 @if test -w @prefix@ ; then \
87 mkdir -p @prefix@/pdk/bin/ ;\
88 cp common/cleanup_unref.py @prefix@/pdk/bin/ ;\
89 cp common/soc_floorplanner.py @prefix@/pdk/bin/ ;\
90 ${CPP} -DPREFIX=@prefix@ common/create_project.py \
91 @prefix@/pdk/bin/create_project.py ;\
92 echo "Common install: Done." ;\
93 else \
94 echo "Common install: @prefix@ is not writeable (ignoring)." ;\
95 fi
Tim Edwards10aa9ab2021-03-15 17:46:29 -040096
Tim Edwards053cff32021-03-13 17:17:36 -050097#---------------------------------------------------
98
Tim Edwards55f4d0e2020-07-05 15:41:02 -040099tech_sky130:
100 (cd sky130 && ${MAKE} all)
101
102#---------------------------------------------------
103
Tim Edwards7cbaaba2020-08-05 12:19:18 -0400104install-sky130: sky130
105 (cd sky130 && ${MAKE} install)
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400106
Tim Edwards8830dfe2021-02-25 11:29:59 -0500107uninstall-sky130: sky130
108 (cd sky130 && ${MAKE} uninstall)
109
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400110clean-sky130:
111 (cd sky130 && ${MAKE} clean)
112
113veryclean-sky130:
114 (cd sky130 && ${MAKE} veryclean)
115
Tim Edwards6ee11532021-02-11 12:29:33 -0500116#---------------------------------------------------