Commit | Line | Data |
---|---|---|
252b5132 RH |
1 | # |
2 | # Makefile for binutils under openVMS (Alpha and Vax) | |
3 | # | |
4 | # For use with gnu-make for vms | |
5 | # | |
6 | # Created by Klaus K"ampf, kkaempf@rmi.de | |
7 | # | |
8 | # | |
9 | ||
10 | # Distribution version, filled in by configure.com | |
11 | VERSION=@VERSION@ | |
12 | ||
13 | ifeq ($(ARCH),ALPHA) | |
14 | TARGET=""vms-alpha"" | |
15 | else | |
16 | TARGET=""vms-vax"" | |
17 | endif | |
18 | ||
19 | ifeq ($(CC),gcc) | |
20 | CFLAGS=/include=([],[-.include],[-.bfd])$(DEFS) | |
21 | DEFS=/define=("TARGET=$(TARGET)") | |
22 | LIBS=,gnu_cc_library:libgcc/lib,sys$$library:vaxcrtl.olb/lib,gnu_cc_library:crt0.obj | |
23 | else | |
24 | CFLAGS=/noopt/debug/include=([],[-.include],[-.bfd])$(DEFS)\ | |
25 | /warnings=disable=(missingreturn,implicitfunc,longextern) | |
26 | DEFS=/define=("TARGET=$(TARGET)","const=","unlink=remove") | |
27 | LIBS=,sys$$library:vaxcrtl.olb/lib | |
28 | endif | |
29 | ||
30 | BFDLIB = [-.bfd]libbfd.olb/lib | |
31 | BFDLIB_DEP = [-.bfd]libbfd.olb | |
32 | LIBIBERTY_DEP = [-.libiberty]libiberty.olb | |
33 | LIBIBERTY = [-.libiberty]libiberty.olb/lib | |
34 | OPCODES_DEP = [-.opcodes]libopcodes.olb | |
35 | OPCODES = [-.opcodes]libopcodes.olb/lib | |
36 | ||
37 | DEBUG_OBJS = rddbg.obj,debug.obj,stabs.obj,ieee.obj,rdcoff.obj | |
38 | ||
39 | WRITE_DEBUG_OBJS = $(DEBUG_OBJS),wrstabs.obj | |
40 | ||
41 | BULIBS = []bucomm.obj,version.obj,filemode.obj | |
42 | ||
43 | ADDL_DEPS = $(BULIBS),$(BFDLIB_DEP),$(LIBIBERTY_DEP) | |
44 | ADDL_LIBS = $(BULIBS),$(BFDLIB),$(LIBIBERTY) | |
45 | ||
46 | SIZEOBJS = $(ADDL_DEPS),size.obj | |
47 | ||
48 | STRINGSOBJS = $(ADDL_DEPS),strings.obj | |
49 | ||
50 | NMOBJS = $(ADDL_DEPS),nm.obj | |
51 | ||
52 | OBJDUMPOBJS = $(ADDL_DEPS),objdump.obj,prdbg.obj,$(DEBUG_OBJS),$(OPCODES_DEP) | |
53 | ||
54 | all: config.h size.exe strings.exe objdump.exe nm.exe | |
55 | ||
56 | size.exe: $(SIZEOBJS) | |
57 | link/exe=$@ size.obj,$(ADDL_LIBS)$(LIBS) | |
58 | ||
59 | strings.exe: $(STRINGSOBJS) | |
60 | link/exe=$@ strings.obj,$(ADDL_LIBS)$(LIBS) | |
61 | ||
62 | nm.exe: $(NMOBJS) | |
63 | link/exe=$@ nm.obj,$(ADDL_LIBS)$(LIBS) | |
64 | ||
65 | objdump.exe: $(OBJDUMPOBJS) | |
66 | link/exe=$@ objdump.obj,prdbg.obj,$(DEBUG_OBJS),$(BFDLIB),$(OPCODES),$(ADDL_LIBS)$(LIBS) | |
67 | ||
68 | ||
69 | version.obj: version.c | |
70 | $(CC) $(CFLAGS)/define=(VERSION="""$(VERSION)""") $< | |
71 | ||
72 | config.h: | |
73 | $$ @configure | |
74 | $(MAKE) -f makefile.vms "CC=$(CC)" | |
75 | ||
76 | [-.bfd]libbfd.olb: | |
77 | $(CD) [-.bfd] | |
78 | $(MAKE) -f makefile.vms "CC=$(CC)" | |
79 | $(CD) [-.binutils] | |
80 | ||
81 | [-.libiberty]libiberty.olb: | |
82 | $(CD) [-.libiberty] | |
83 | $(MAKE) -f makefile.vms "CC=$(CC)" | |
84 | $(CD) [-.binutils] | |
85 | ||
86 | [-.opcodes]libopcodes.olb: | |
87 | $(CD) [-.opcodes] | |
88 | $(MAKE) -f makefile.vms "CC=$(CC)" | |
89 | $(CD) [-.binutils] | |
90 | ||
91 | clean: | |
92 | $$ purge | |
93 | $(RM) *.obj; | |
94 | $(RM) *.exe; | |
95 | ||
96 | distclean: clean | |
97 | $(RM) config.h; | |
98 | $(RM) makefile.vms; |