Tim Edwards | 55f4d0e | 2020-07-05 15:41:02 -0400 | [diff] [blame] | 1 | #--------------------------------------------------- |
| 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 Edwards | 7cbaaba | 2020-08-05 12:19:18 -0400 | [diff] [blame] | 14 | # make install |
Tim Edwards | 55f4d0e | 2020-07-05 15:41:02 -0400 | [diff] [blame] | 15 | # |
Tim Edwards | 7cbaaba | 2020-08-05 12:19:18 -0400 | [diff] [blame] | 16 | # 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 Edwards | 55f4d0e | 2020-07-05 15:41:02 -0400 | [diff] [blame] | 23 | # |
| 24 | # make clean |
| 25 | # |
| 26 | # clean up all files generated by 'make' |
| 27 | # |
Tim Edwards | 7cbaaba | 2020-08-05 12:19:18 -0400 | [diff] [blame] | 28 | # make veryclean |
| 29 | # |
| 30 | # clean up all files generated by 'make' and remove |
| 31 | # all log files. |
| 32 | # |
Tim Edwards | 8830dfe | 2021-02-25 11:29:59 -0500 | [diff] [blame] | 33 | # make uninstall |
| 34 | # |
| 35 | # remove the installed PDKs. |
| 36 | # |
Tim Edwards | 55f4d0e | 2020-07-05 15:41:02 -0400 | [diff] [blame] | 37 | #--------------------------------------------------- |
| 38 | # |
| 39 | # The following definitions are tied to the contents |
| 40 | # of this repository and should not be changed. |
| 41 | |
Tim Edwards | 8292c90 | 2020-12-24 16:25:25 -0500 | [diff] [blame] | 42 | TECHS = |
| 43 | |
| 44 | SKY130_SOURCE_PATH = @SKY130_SOURCE_PATH@ |
| 45 | ifneq ($(SKY130_SOURCE_PATH),) |
| 46 | TECHS += sky130 |
| 47 | endif |
| 48 | |
| 49 | DONE_MESSAGE = "Done." |
| 50 | ifeq ($(TECHS),) |
| 51 | DONE_MESSAGE = "No techs configured." |
| 52 | endif |
| 53 | |
| 54 | TECHS_ALL = $(addprefix tech_,$(TECHS)) |
| 55 | TECHS_INSTALL = $(addprefix install-,$(TECHS)) |
Tim Edwards | 8830dfe | 2021-02-25 11:29:59 -0500 | [diff] [blame] | 56 | TECHS_UNINSTALL = $(addprefix uninstall-,$(TECHS)) |
Tim Edwards | 8292c90 | 2020-12-24 16:25:25 -0500 | [diff] [blame] | 57 | TECHS_CLEAN = $(addprefix clean-,$(TECHS)) |
| 58 | TECHS_VERYCLEAN = $(addprefix veryclean-,$(TECHS)) |
Tim Edwards | 55f4d0e | 2020-07-05 15:41:02 -0400 | [diff] [blame] | 59 | |
| 60 | #--------------------------------------------------- |
| 61 | |
Tim Edwards | 8292c90 | 2020-12-24 16:25:25 -0500 | [diff] [blame] | 62 | all: $(TECHS_ALL) |
| 63 | @echo $(DONE_MESSAGE) |
| 64 | |
Tim Edwards | 053cff3 | 2021-03-13 17:17:36 -0500 | [diff] [blame] | 65 | install: $(TECHS_INSTALL) common_install |
Tim Edwards | 8292c90 | 2020-12-24 16:25:25 -0500 | [diff] [blame] | 66 | @echo $(DONE_MESSAGE) |
| 67 | |
Tim Edwards | 8830dfe | 2021-02-25 11:29:59 -0500 | [diff] [blame] | 68 | uninstall: $(TECHS_UNINSTALL) |
| 69 | @echo $(DONE_MESSAGE) |
| 70 | |
Tim Edwards | 8292c90 | 2020-12-24 16:25:25 -0500 | [diff] [blame] | 71 | clean: $(TECHS_CLEAN) |
| 72 | @echo $(DONE_MESSAGE) |
| 73 | |
| 74 | veryclean: $(TECHS_VERYCLEAN) |
| 75 | @echo $(DONE_MESSAGE) |
| 76 | |
| 77 | distclean: $(TECHS_VERYCLEAN) |
Tim Edwards | 6ee1153 | 2021-02-11 12:29:33 -0500 | [diff] [blame] | 78 | ${RM} -rf sources |
Tim Edwards | 8292c90 | 2020-12-24 16:25:25 -0500 | [diff] [blame] | 79 | @echo $(DONE_MESSAGE) |
Tim Edwards | 55f4d0e | 2020-07-05 15:41:02 -0400 | [diff] [blame] | 80 | |
| 81 | #--------------------------------------------------- |
| 82 | |
Tim Edwards | 10aa9ab | 2021-03-15 17:46:29 -0400 | [diff] [blame] | 83 | CPP = common/preproc.py |
| 84 | |
Tim Edwards | 053cff3 | 2021-03-13 17:17:36 -0500 | [diff] [blame] | 85 | common_install: |
Tim Edwards | cdfec5e | 2021-04-22 20:59:13 -0400 | [diff] [blame] | 86 | @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 Edwards | 10aa9ab | 2021-03-15 17:46:29 -0400 | [diff] [blame] | 96 | |
Tim Edwards | 053cff3 | 2021-03-13 17:17:36 -0500 | [diff] [blame] | 97 | #--------------------------------------------------- |
| 98 | |
Tim Edwards | 55f4d0e | 2020-07-05 15:41:02 -0400 | [diff] [blame] | 99 | tech_sky130: |
| 100 | (cd sky130 && ${MAKE} all) |
| 101 | |
| 102 | #--------------------------------------------------- |
| 103 | |
Tim Edwards | 7cbaaba | 2020-08-05 12:19:18 -0400 | [diff] [blame] | 104 | install-sky130: sky130 |
| 105 | (cd sky130 && ${MAKE} install) |
Tim Edwards | 55f4d0e | 2020-07-05 15:41:02 -0400 | [diff] [blame] | 106 | |
Tim Edwards | 8830dfe | 2021-02-25 11:29:59 -0500 | [diff] [blame] | 107 | uninstall-sky130: sky130 |
| 108 | (cd sky130 && ${MAKE} uninstall) |
| 109 | |
Tim Edwards | 55f4d0e | 2020-07-05 15:41:02 -0400 | [diff] [blame] | 110 | clean-sky130: |
| 111 | (cd sky130 && ${MAKE} clean) |
| 112 | |
| 113 | veryclean-sky130: |
| 114 | (cd sky130 && ${MAKE} veryclean) |
| 115 | |
Tim Edwards | 6ee1153 | 2021-02-11 12:29:33 -0500 | [diff] [blame] | 116 | #--------------------------------------------------- |