Home | History | Annotate | Line # | Download | only in objc
      1 # Top level -*- makefile -*- fragment for GNU Objective-C
      2 #   Copyright (C) 1997-2022 Free Software Foundation, Inc.
      3 
      4 #This file is part of GCC.
      5 
      6 #GCC is free software; you can redistribute it and/or modify
      7 #it under the terms of the GNU General Public License as published by
      8 #the Free Software Foundation; either version 3, or (at your option)
      9 #any later version.
     10 
     11 #GCC is distributed in the hope that it will be useful,
     12 #but WITHOUT ANY WARRANTY; without even the implied warranty of
     13 #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     14 #GNU General Public License for more details.
     15 
     16 # You should have received a copy of the GNU General Public License
     17 # along with GCC; see the file COPYING3.  If not see
     18 # <http://www.gnu.org/licenses/>.
     19 
     20 
     21 # This file provides the language dependent support in the main Makefile.
     22 # Each language makefile fragment must provide the following targets:
     23 #
     24 # foo.all.cross, foo.start.encap, foo.rest.encap,
     25 # foo.install-common, foo.install-man, foo.install-info, foo.install-pdf,
     26 # foo.install-html, foo.info, foo.dvi, foo.pdf, foo.html, foo.uninstall,
     27 # foo.mostlyclean, foo.clean, foo.distclean,
     28 # foo.maintainer-clean, foo.stage1, foo.stage2, foo.stage3, foo.stage4
     29 #
     30 # where `foo' is the name of the language.
     31 #
     32 # It should also provide rules for:
     33 #
     34 # - making any compiler driver (eg: g++)
     35 # - the compiler proper (eg: cc1plus)
     36 # - define the names for selecting the language in LANGUAGES.
     37 
     38 #
     40 # Define the names for selecting Objective-C in LANGUAGES.
     41 objc: cc1obj$(exeext)
     42 objc.serial = cc1obj$(exeext)
     43 
     44 # Tell GNU make to ignore these if they exist.
     45 .PHONY: objc
     46 
     47 # Use maximal warnings for this front end.
     48 objc-warn = $(STRICT_WARN)
     49 
     50 # Language-specific object files for Objective C.
     51 OBJC_OBJS = objc/objc-lang.o objc/objc-act.o hash-table.o \
     52    objc/objc-runtime-shared-support.o \
     53    objc/objc-gnu-runtime-abi-01.o \
     54    objc/objc-next-runtime-abi-01.o \
     55    objc/objc-next-runtime-abi-02.o \
     56    objc/objc-encoding.o \
     57    objc/objc-map.o
     58 
     59 objc_OBJS = $(OBJC_OBJS) cc1obj-checksum.o
     60 
     61 # compute checksum over all object files and the options
     62 # re-use the checksum from the prev-final stage so it passes
     63 # the bootstrap comparison and allows comparing of the cc1 binary
     64 cc1obj-checksum.cc : build/genchecksum$(build_exeext) checksum-options \
     65         $(OBJC_OBJS) $(C_AND_OBJC_OBJS) $(BACKEND) $(LIBDEPS)
     66 	if [ -f ../stage_final ] \
     67 	   && cmp -s ../stage_current ../stage_final \
     68 	   && [ -f ../prev-gcc/$@ ]; then \
     69 	  cp ../prev-gcc/$@ $@; \
     70 	else \
     71 	  build/genchecksum$(build_exeext) $(OBJC_OBJS) $(C_AND_OBJC_OBJS) \
     72 		$(BACKEND) $(LIBDEPS) checksum-options > $@.tmp && \
     73 	  $(SHELL) $(srcdir)/../move-if-change $@.tmp $@; \
     74 	fi
     75 
     76 cc1obj$(exeext): $(OBJC_OBJS) $(C_AND_OBJC_OBJS) cc1obj-checksum.o $(BACKEND) \
     77 		 $(LIBDEPS) $(objc.prev)
     78 	@$(call LINK_PROGRESS,$(INDEX.objc),start)
     79 	+$(LLINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -o $@ \
     80 	      $(OBJC_OBJS) $(C_AND_OBJC_OBJS) cc1obj-checksum.o \
     81 	      $(BACKEND) $(LIBS) $(BACKENDLIBS)
     82 	@$(call LINK_PROGRESS,$(INDEX.objc),end)
     83 
     84 objc.srcextra:
     85 
     86 #
     88 # Build hooks:
     89 
     90 objc.all.cross:
     91 objc.start.encap:
     92 objc.rest.encap:
     93 objc.info:
     94 objc.install-info:
     95 objc.dvi:
     96 objc.install-dvi:
     97 objc.pdf:
     98 objc.install-pdf:
     99 objc.html:
    100 objc.install-html:
    101 objc.man:
    102 objc.srcinfo:
    103 objc.srcman:
    104 objc.install-plugin:
    105 
    106 objc.tags: force
    107 	cd $(srcdir)/objc; $(ETAGS) -o TAGS.sub *.c *.h; \
    108 	$(ETAGS) --include TAGS.sub --include ../TAGS.sub
    109 
    110 lang_checks += check-objc
    111 
    112 # The following allows you to do 'make check-objc -j2'.  The
    113 # execute.exp tests will be run in parallel with all the other ones.
    114 lang_checks_parallelized += check-objc
    115 check_objc_parallelize = 6
    116 
    117 # No objc-c-specific selftests
    118 selftest-objc:
    119 
    120 #
    122 # Install hooks:
    123 # cc1obj is installed elsewhere as part of $(COMPILERS).
    124 
    125 objc.install-common:
    126 
    127 objc.install-man:
    128 
    129 objc.uninstall:
    130 #
    132 # Clean hooks:
    133 # A lot of the ancillary files are deleted by the main makefile.
    134 # We just have to delete files specific to us.
    135 objc.mostlyclean:
    136 	-rm -f objc/*$(objext) objc/xforward objc/fflags
    137 	-rm -f objc/*$(coverageexts)
    138 	-rm -f cc1obj$(exeext)
    139 objc.clean: objc.mostlyclean
    140 	-rm -rf objc-headers
    141 objc.distclean:
    142 	-rm -f objc/Makefile objc/Make-host objc/Make-target
    143 	-rm -f objc/config.status objc/config.cache
    144 objc.maintainer-clean:
    145 
    146 #
    148 # Stage hooks:
    149 
    150 objc.stage1: stage1-start
    151 	-mv objc/*$(objext) stage1/objc
    152 objc.stage2: stage2-start
    153 	-mv objc/*$(objext) stage2/objc
    154 objc.stage3: stage3-start
    155 	-mv objc/*$(objext) stage3/objc
    156 objc.stage4: stage4-start
    157 	-mv objc/*$(objext) stage4/objc
    158 objc.stageprofile: stageprofile-start
    159 	-mv objc/*$(objext) stageprofile/objc
    160 objc.stagefeedback: stagefeedback-start
    161 	-mv objc/*$(objext) stagefeedback/objc
    162