1#
2# Makefile for binutils under openVMS (Alpha and Itanium)
3#
4# For use with gnu-make for vms
5#
6# Created by Klaus Kaempf, kkaempf@rmi.de
7#
8#   Copyright (C) 2012-2017 Free Software Foundation, Inc.
9#
10# This file is free software; you can redistribute it and/or modify
11# it under the terms of the GNU General Public License as published by
12# the Free Software Foundation; either version 3 of the License, or
13# (at your option) any later version.
14#
15# This program is distributed in the hope that it will be useful,
16# but WITHOUT ANY WARRANTY; without even the implied warranty of
17# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18# GNU General Public License for more details.
19#
20# You should have received a copy of the GNU General Public License
21# along with this program; see the file COPYING3.  If not see
22# <http://www.gnu.org/licenses/>.
23#
24
25DEFS=/define=("OBJDUMP_PRIVATE_VECTORS=")
26OPT=/noopt/debug
27CFLAGS=$(OPT)/include=([],"../include",[-.bfd])$(DEFS)\
28 /name=(as_is,shortened)\
29 /prefix=(all,except=("getopt","optarg","optopt","optind","opterr"))\
30 /warns=(info=(ptrmismatch,shiftcount))
31
32LIBBFD = [-.bfd]libbfd.olb/lib
33LIBBFD_DEP = [-.bfd]libbfd.olb
34LIBIBERTY_DEP = [-.libiberty]libiberty.olb
35LIBIBERTY = [-.libiberty]libiberty.olb/lib
36OPCODES_DEP = [-.opcodes]libopcodes.olb
37OPCODES = [-.opcodes]libopcodes.olb/lib
38
39DEBUG_OBJS = rddbg.obj,debug.obj,stabs.obj,ieee.obj,rdcoff.obj,dwarf.obj,\
40  elfcomm.obj
41
42BULIBS = bucomm.obj,version.obj,filemode.obj
43
44ADDL_DEPS = $(BULIBS),$(LIBBFD_DEP),$(LIBIBERTY_DEP)
45ADDL_LIBS = $(BULIBS),$(LIBBFD),$(LIBIBERTY)
46
47SIZEOBJS = $(ADDL_DEPS),size.obj
48
49STRINGSOBJS = $(ADDL_DEPS),strings.obj
50
51NMOBJS = $(ADDL_DEPS),nm.obj
52
53ADDR2LINEOBJS = $(ADDL_DEPS),addr2line.obj
54
55OBJDUMPOBJS = objdump.obj,prdbg.obj,$(DEBUG_OBJS),$(ADDL_DEPS),$(OPCODES_DEP)
56
57READELFOBJS = readelf.obj,dwarf.obj,unwind-ia64.obj,$(ADDL_DEPS)
58
59all: config.h size.exe strings.exe objdump.exe nm.exe addr2line.exe
60
61size.exe: $(SIZEOBJS)
62	link/exe=$@ size.obj,$(ADDL_LIBS)
63
64strings.exe: $(STRINGSOBJS)
65	link/exe=$@ strings.obj,$(ADDL_LIBS)
66
67nm.exe: $(NMOBJS)
68	link/exe=$@ nm.obj,$(ADDL_LIBS)
69
70addr2line.exe: $(ADDR2LINEOBJS)
71	link/exe=$@ addr2line.obj,$(ADDL_LIBS)
72
73objdump.exe: $(OBJDUMPOBJS)
74	link/exe=$@ objdump.obj,prdbg.obj,$(DEBUG_OBJS),$(ADDL_LIBS),$(OPCODES)
75
76readelf.exe: $(READELFOBJS)
77	link/exe=$@ readelf.obj,dwarf.obj,unwind-ia64.obj,$(ADDL_LIBS)
78
79config.h:
80	$$ @configure
81	$(MAKE) -f makefile.vms "CC=$(CC)"
82
83clean:
84	$$ purge
85	$(RM) *.obj;
86	$(RM) *.exe;
87
88distclean: clean
89	$(RM) config.h;
90	$(RM) makefile.vms;
91