| 1 | # ========== Copyright Header Begin ========================================== |
| 2 | # |
| 3 | # OpenSPARC T2 Processor File: Makefile.common |
| 4 | # Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved. |
| 5 | # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES. |
| 6 | # |
| 7 | # The above named program is free software; you can redistribute it and/or |
| 8 | # modify it under the terms of the GNU General Public |
| 9 | # License version 2 as published by the Free Software Foundation. |
| 10 | # |
| 11 | # The above named program is distributed in the hope that it will be |
| 12 | # useful, but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 14 | # General Public License for more details. |
| 15 | # |
| 16 | # You should have received a copy of the GNU General Public |
| 17 | # License along with this work; if not, write to the Free Software |
| 18 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. |
| 19 | # |
| 20 | # ========== Copyright Header End ============================================ |
| 21 | # |
| 22 | # ni_mod/Makefile.common - to be included only from the ni_mod/subdirectorys |
| 23 | # |
| 24 | # |
| 25 | # ni_mod/subdir/Makefile invoked as: make $TARG MOD=<subdir> TARG=$TARG |
| 26 | # |
| 27 | |
| 28 | |
| 29 | # when in a subdir of ni_mod # |
| 30 | # |
| 31 | TOPDIR = ../../.. |
| 32 | |
| 33 | |
| 34 | |
| 35 | CFLAGS += -Kpic -mt -dalign |
| 36 | |
| 37 | |
| 38 | |
| 39 | |
| 40 | CCOBJS = $(CCFILES:%.cc=$(TARG)/%.o) |
| 41 | |
| 42 | $(TARG): setup $(CCOBJS) |
| 43 | $(LD) -G -o $(TARG)/$(MOD).so $(CCOBJS) |
| 44 | if $(TEST) -e ../obj$(TARG)/$(MOD).so ; then true; \ |
| 45 | else \ |
| 46 | $(LN) -s ../$(MOD)/$(TARG)/$(MOD).so ../obj$(TARG)/. ; \ |
| 47 | fi |
| 48 | |
| 49 | |
| 50 | $(CLEANTARGS):: setup |
| 51 | - $(RM) -rf $(CCOBJS) $(TARG)/$(MOD).so |
| 52 | |
| 53 | $(TARG)/%.o: %.cc |
| 54 | echo "ni_mod/Makefile.common: $(TARG): making $@ |
| 55 | $(COMPILE.cc) -c -o $@ $< |
| 56 | |
| 57 | |
| 58 | setup: |
| 59 | @ if $(TEST) -d $(TARG); then true; else mkdir $(TARG); fi; |
| 60 | |
| 61 | FRC: |