| 1 | #Copyright 1989, 90, 91, 92, 93, 94, 95, 96, 1997 |
| 2 | #Free Software Foundation, Inc. |
| 3 | |
| 4 | # This file is part of GDB. |
| 5 | |
| 6 | # This program 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 2 of the License, or |
| 9 | # (at your option) any later version. |
| 10 | # |
| 11 | # This program 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 this program; if not, write to the Free Software |
| 18 | # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
| 19 | |
| 20 | prefix = /usr/local |
| 21 | |
| 22 | program_transform_name = |
| 23 | exec_prefix = $(prefix) |
| 24 | bindir = $(exec_prefix)/bin |
| 25 | libdir = $(exec_prefix)/lib |
| 26 | tooldir = $(libdir)/$(target_alias) |
| 27 | |
| 28 | datadir = $(prefix)/share |
| 29 | mandir = $(prefix)/man |
| 30 | man1dir = $(mandir)/man1 |
| 31 | man2dir = $(mandir)/man2 |
| 32 | man3dir = $(mandir)/man3 |
| 33 | man4dir = $(mandir)/man4 |
| 34 | man5dir = $(mandir)/man5 |
| 35 | man6dir = $(mandir)/man6 |
| 36 | man7dir = $(mandir)/man7 |
| 37 | man8dir = $(mandir)/man8 |
| 38 | man9dir = $(mandir)/man9 |
| 39 | infodir = $(prefix)/info |
| 40 | includedir = $(prefix)/include |
| 41 | |
| 42 | SHELL = /bin/sh |
| 43 | |
| 44 | INSTALL = `cd $(srcdir)/../..;pwd`/install-sh -c |
| 45 | INSTALL_PROGRAM = $(INSTALL) |
| 46 | INSTALL_DATA = $(INSTALL) |
| 47 | |
| 48 | AR = ar |
| 49 | AR_FLAGS = qv |
| 50 | RANLIB = ranlib |
| 51 | |
| 52 | # If you are compiling with GCC, make sure that either 1) You use the |
| 53 | # -traditional flag, or 2) You have the fixed include files where GCC |
| 54 | # can reach them. Otherwise the ioctl calls in inflow.c |
| 55 | # will be incorrectly compiled. The "fixincludes" script in the gcc |
| 56 | # distribution will fix your include files up. |
| 57 | #CC=cc |
| 58 | #CC=gcc -traditional |
| 59 | GCC=gcc |
| 60 | |
| 61 | # Directory containing source files. Don't clean up the spacing, |
| 62 | # this exact string is matched for by the "configure" script. |
| 63 | srcdir = . |
| 64 | |
| 65 | # It is also possible that you will need to add -I/usr/include/sys to the |
| 66 | # CFLAGS section if your system doesn't have fcntl.h in /usr/include (which |
| 67 | # is where it should be according to Posix). |
| 68 | |
| 69 | # Set this up with gcc if you have gnu ld and the loader will print out |
| 70 | # line numbers for undefinded refs. |
| 71 | #CC-LD=gcc -static |
| 72 | CC-LD=${CC} |
| 73 | |
| 74 | # Where is the "include" directory? Traditionally ../include or ./include |
| 75 | INCLUDE_DIR = ${srcdir}/../../include |
| 76 | INCLUDE_DEP = $$(INCLUDE_DIR) |
| 77 | |
| 78 | # Where are the BFD library? |
| 79 | BFD_DIR = ../../bfd |
| 80 | BFD = $(BFD_DIR)/libbfd.a |
| 81 | BFD_SRC = $(srcdir)/$(BFD_DIR) |
| 82 | BFD_CFLAGS = -I$(BFD_DIR) -I$(BFD_SRC) |
| 83 | |
| 84 | # Where is the source dir for the READLINE library? Traditionally in .. or . |
| 85 | # (For the binary library built from it, we use ${READLINE_DIR}${subdir}.) |
| 86 | READLINE_DIR = ${srcdir}/../readline |
| 87 | READLINE_DEP = $$(READLINE_DIR) |
| 88 | |
| 89 | # All the includes used for CFLAGS and for lint. |
| 90 | # -I. for config files. |
| 91 | # -I${srcdir} possibly for regex.h also. |
| 92 | # -I${srcdir}/config for more generic config files. |
| 93 | INCLUDE_CFLAGS = -I. -I${srcdir} -I${srcdir}/.. -I${srcdir}/../config -I$(INCLUDE_DIR) |
| 94 | |
| 95 | # M{H,T}_CFLAGS, if defined, has host- and target-dependent CFLAGS |
| 96 | # from the config/ directory. |
| 97 | GLOBAL_CFLAGS = ${MT_CFLAGS} ${MH_CFLAGS} |
| 98 | #PROFILE_CFLAGS = -pg |
| 99 | |
| 100 | # CFLAGS is specifically reserved for setting from the command line |
| 101 | # when running make. I.E. "make CFLAGS=-Wmissing-prototypes". |
| 102 | CFLAGS = -g |
| 103 | # INTERNAL_CFLAGS is the aggregate of all other *CFLAGS macros. |
| 104 | INTERNAL_CFLAGS = ${CFLAGS} ${GLOBAL_CFLAGS} ${PROFILE_CFLAGS} \ |
| 105 | ${BFD_CFLAGS} ${INCLUDE_CFLAGS} |
| 106 | |
| 107 | # LDFLAGS is specifically reserved for setting from the command line |
| 108 | # when running make. |
| 109 | |
| 110 | # Perhaps should come from parent Makefile |
| 111 | VERSION = gdbserver-4.12.3 |
| 112 | DIST=gdb |
| 113 | |
| 114 | LINT=/usr/5bin/lint |
| 115 | LINTFLAGS= $(BFD_CFLAGS) |
| 116 | |
| 117 | # Host and target-dependent makefile fragments come in here. |
| 118 | #### |
| 119 | # End of host and target-dependent makefile fragments |
| 120 | |
| 121 | # All source files that go into linking GDB remote server. |
| 122 | |
| 123 | SFILES = $(srcdir)/low-lynx.c $(srcdir)/low-sparc.c $(srcdir)/low-sun3.c \ |
| 124 | $(srcdir)/low-hppabsd.c \ |
| 125 | $(srcdir)/utils.c $(srcdir)/server.c $(srcdir)/remote-utils.c |
| 126 | |
| 127 | DEPFILES = $(GDBSERVER_DEPFILES) |
| 128 | |
| 129 | SOURCES = $(SFILES) $(ALLDEPFILES) |
| 130 | TAGFILES = $(SOURCES) ${HFILES} ${ALLPARAM} ${POSSLIBS} |
| 131 | |
| 132 | OBS = utils.o $(GDBSERVER_DEPFILES) server.o remote-utils.o |
| 133 | |
| 134 | # Prevent Sun make from putting in the machine type. Setting |
| 135 | # TARGET_ARCH to nothing works for SunOS 3, 4.0, but not for 4.1. |
| 136 | .c.o: |
| 137 | ${CC} -c ${INTERNAL_CFLAGS} $< |
| 138 | |
| 139 | all: gdbserver gdbreplay |
| 140 | |
| 141 | # Traditionally "install" depends on "all". But it may be useful |
| 142 | # not to; for example, if the user has made some trivial change to a |
| 143 | # source file and doesn't care about rebuilding or just wants to save the |
| 144 | # time it takes for make to check that all is up to date. |
| 145 | # install-only is intended to address that need. |
| 146 | install: all install-only |
| 147 | install-only: |
| 148 | n=`echo gdbserver | sed '$(program_transform_name)'`; \ |
| 149 | if [ x$$n = x ]; then n=gdbserver; else true; fi; \ |
| 150 | $(INSTALL_PROGRAM) gdbserver $(bindir)/$$n; \ |
| 151 | $(INSTALL_DATA) $(srcdir)/gdbserver.1 $(man1dir)/$$n.1 |
| 152 | |
| 153 | uninstall: force |
| 154 | n=`echo gdbserver | sed '$(program_transform_name)'`; \ |
| 155 | if [ x$$n = x ]; then n=gdbserver; else true; fi; \ |
| 156 | rm -f $(bindir)/$$n $(man1dir)/$$n.1 |
| 157 | |
| 158 | installcheck: |
| 159 | check: |
| 160 | info dvi: |
| 161 | install-info: |
| 162 | clean-info: |
| 163 | |
| 164 | gdbserver: $(OBS) ${ADD_DEPS} ${CDEPS} |
| 165 | rm -f gdbserver |
| 166 | ${CC-LD} $(GLOBAL_CFLAGS) $(LDFLAGS) -o gdbserver $(OBS) \ |
| 167 | $(GDBSERVER_LIBS) $(XM_CLIBS) |
| 168 | |
| 169 | gdbreplay: gdbreplay.o |
| 170 | rm -f gdbreplay |
| 171 | ${CC-LD} $(GLOBAL_CFLAGS) $(LDFLAGS) -o gdbreplay gdbreplay.o \ |
| 172 | $(XM_CLIBS) |
| 173 | |
| 174 | config.status: |
| 175 | @echo "You must configure gdbserver. Look at the README file for details." |
| 176 | @false |
| 177 | |
| 178 | # Put the proper machine-specific files first, so M-. on a machine |
| 179 | # specific routine gets the one for the correct machine. |
| 180 | # The xyzzy stuff below deals with empty DEPFILES |
| 181 | TAGS: ${TAGFILES} |
| 182 | etags `find ${srcdir}/../config -name $(TM_FILE) -print` \ |
| 183 | `find ${srcdir}/../config -name ${XM_FILE} -print` \ |
| 184 | `find ${srcdir}/../config -name ${NAT_FILE} -print` \ |
| 185 | `for i in yzzy ${DEPFILES}; do \ |
| 186 | if [ x$$i != xyzzy ]; then \ |
| 187 | echo ${srcdir}/$$i | sed -e 's/\.o$$/\.c/' ; \ |
| 188 | fi; \ |
| 189 | done` \ |
| 190 | ${TAGFILES} |
| 191 | tags: TAGS |
| 192 | |
| 193 | clean: |
| 194 | rm -f *.o ${ADD_FILES} *~ |
| 195 | rm -f gdbserver core make.log |
| 196 | |
| 197 | distclean: clean |
| 198 | rm -f nm.h tm.h xm.h config.status |
| 199 | rm -f Makefile |
| 200 | |
| 201 | maintainer-clean realclean: clean |
| 202 | rm -f nm.h tm.h xm.h config.status |
| 203 | rm -f Makefile |
| 204 | |
| 205 | STAGESTUFF=${OBS} ${TSOBS} ${NTSOBS} ${ADD_FILES} init.c init.o version.c gdb |
| 206 | |
| 207 | Makefile: $(srcdir)/Makefile.in $(host_makefile_frag) $(target_makefile_frag) |
| 208 | $(SHELL) ./config.status |
| 209 | |
| 210 | force: |
| 211 | |
| 212 | version.c: Makefile |
| 213 | echo 'char *version = "$(VERSION)";' >version.c |
| 214 | |
| 215 | # GNU Make has an annoying habit of putting *all* the Makefile variables |
| 216 | # into the environment, unless you include this target as a circumvention. |
| 217 | # Rumor is that this will be fixed (and this target can be removed) |
| 218 | # in GNU Make 4.0. |
| 219 | .NOEXPORT: |
| 220 | |
| 221 | # GNU Make 3.63 has a different problem: it keeps tacking command line |
| 222 | # overrides onto the definition of $(MAKE). This variable setting |
| 223 | # will remove them. |
| 224 | MAKEOVERRIDES= |
| 225 | |
| 226 | ## This is ugly, but I don't want GNU make to put these variables in |
| 227 | ## the environment. Older makes will see this as a set of targets |
| 228 | ## with no dependencies and no actions. |
| 229 | unexport CHILLFLAGS CHILL_LIB CHILL_FOR_TARGET : |
| 230 | |
| 231 | server.o : ${srcdir}/server.c ${srcdir}/server.h |
| 232 | remote-utils.o : ${srcdir}/remote-utils.c ${srcdir}/server.h |
| 233 | low-linux.o : ${srcdir}/low-linux.c ${srcdir}/server.h |
| 234 | low-lynx.o : ${srcdir}/low-lynx.c ${srcdir}/server.h |
| 235 | low-sim.o : ${srcdir}/low-sim.c ${srcdir}/server.h |
| 236 | low-sparc.o : $(srcdir)/low-sparc.c $(srcdir)/server.h |
| 237 | low-sun3.o : $(srcdir)/low-sun3.c $(srcdir)/server.h |
| 238 | low-hppabsd.o : $(srcdir)/low-hppabsd.c $(srcdir)/server.h |
| 239 | utils.o : ${srcdir}/utils.c ${srcdir}/server.h |
| 240 | |
| 241 | # This is the end of "Makefile.in". |