| 1 | # |
| 2 | # makefile for gas |
| 3 | # |
| 4 | # Created by Klaus K"ampf, kkaempf@progis.de |
| 5 | # |
| 6 | CC=gcc |
| 7 | ifeq ($(ARCH),ALPHA) |
| 8 | ifeq ($(CC),gcc) |
| 9 | DEFS= |
| 10 | CFLAGS=/include=([],[-.bfd],[.config],[-.include],[-])$(DEFS) |
| 11 | LFLAGS= |
| 12 | LIBS=,GNU_CC_LIBRARY:libgcc/lib,sys$$library:vaxcrtl.olb/lib,GNU_CC_LIBRARY:crt0.obj |
| 13 | else |
| 14 | DEFS=/define=("table_size_of_flonum_powers_of_ten"="tabsiz_flonum_powers_of_ten",\ |
| 15 | "_bfd_generic_get_section_contents_in_window"="_bfd_generic_get_win_section_cont",\ |
| 16 | "_elf_section_from_bfd_section"="_bfd_elf_sec_from_bfd_sec","const=") |
| 17 | CFLAGS=/noopt/nodebug/include=([],[-.bfd],[.config],[-.include],[-])$(DEFS)\ |
| 18 | /warnings=disable=(missingreturn,implicitfunc,ptrmismatch,undefescap,longextern,duptypespec) |
| 19 | LFLAGS= |
| 20 | LIBS=,sys$$library:vaxcrtl.olb/lib |
| 21 | endif |
| 22 | |
| 23 | else # ARCH not ALPHA |
| 24 | |
| 25 | ifeq ($(CC),gcc) |
| 26 | DEFS= |
| 27 | CFLAGS=/include=([],[.config],[-.include],[-])$(DEFS) |
| 28 | LFLAGS= |
| 29 | LIBS=,GNU_CC_LIBRARY:libgcc/lib,sys$$library:vaxcrtl.olb/lib,GNU_CC_LIBRARY:crtbegin.obj,GNU_CC_LIBRARY:crtend.obj |
| 30 | #LIBS=,gnu_cc:[000000]gcclib.olb/lib,sys$$library:vaxcrtl.olb/lib |
| 31 | else |
| 32 | error DECC is broken on VAX |
| 33 | DEFS=/define=("table_size_of_flonum_powers_of_ten"="tabsiz_flonum_powers_of_ten","const=") |
| 34 | CFLAGS=/noopt/debug/include=([],[.config],[-.include],[-])$(DEFS)\ |
| 35 | /warnings=disable=(missingreturn,implicitfunc,ptrmismatch,undefescap,longextern,duptypespec) |
| 36 | LFLAGS= |
| 37 | LIBS=,sys$$library:vaxcrtl.olb/lib |
| 38 | endif |
| 39 | endif |
| 40 | |
| 41 | |
| 42 | OBJS=targ-cpu.obj,obj-format.obj,atof-targ.obj,app.obj,as.obj,atof-generic.obj,\ |
| 43 | bignum-copy.obj,cond.obj,depend.obj,expr.obj,flonum-konst.obj,flonum-copy.obj,\ |
| 44 | flonum-mult.obj,frags.obj,hash.obj,input-file.obj,input-scrub.obj,\ |
| 45 | literal.obj,messages.obj,output-file.obj,read.obj,subsegs.obj,symbols.obj,\ |
| 46 | write.obj,listing.obj,ecoff.obj,stabs.obj,sb.obj,macro.obj,ehopt.obj |
| 47 | |
| 48 | GASPOBJS = gasp.obj,macro.obj,sb.obj,hash.obj |
| 49 | |
| 50 | LIBIBERTY = [-.libiberty]libiberty.olb |
| 51 | |
| 52 | ifeq ($(ARCH),ALPHA) |
| 53 | LIBBFD = [-.bfd]libbfd.olb |
| 54 | LIBOPCODES = [-.opcodes]libopcodes.olb |
| 55 | BFDDEP = [-.bfd]bfd.h |
| 56 | else |
| 57 | LIBBFD = |
| 58 | LIBOPCODES = |
| 59 | BFDDEP = |
| 60 | endif |
| 61 | |
| 62 | all: config.status $(BFDDEP) as.exe gasp.exe |
| 63 | |
| 64 | as.exe: $(OBJS) $(LIBOPCODES) $(LIBBFD) $(LIBIBERTY) |
| 65 | ifeq ($(ARCH),ALPHA) |
| 66 | link$(LFLAGS)/exe=$@ $(OBJS),$(LIBOPCODES)/lib,$(LIBBFD)/lib,$(LIBIBERTY)/lib$(LIBS) |
| 67 | else |
| 68 | link$(LFLAGS)/exe=$@ $(OBJS),$(LIBIBERTY)/lib$(LIBS) |
| 69 | endif |
| 70 | |
| 71 | gasp.exe: $(GASPOBJS) $(LIBBFD) $(LIBIBERTY) |
| 72 | ifeq ($(ARCH),ALPHA) |
| 73 | link$(LFLAGS)/exe=$@ $(GASPOBJS),$(LIBBFD)/lib,$(LIBIBERTY)/lib$(LIBS) |
| 74 | else |
| 75 | link$(LFLAGS)/exe=$@ $(GASPOBJS),$(LIBIBERTY)/lib$(LIBS) |
| 76 | endif |
| 77 | |
| 78 | config.status: |
| 79 | $$ @config-gas |
| 80 | |
| 81 | ifeq ($(ARCH),ALPHA) |
| 82 | CPU=alpha |
| 83 | OBJFORMAT=evax |
| 84 | FLTFORMAT=ieee |
| 85 | else |
| 86 | CPU=vax |
| 87 | OBJFORMAT=vms |
| 88 | FLTFORMAT=vax |
| 89 | endif |
| 90 | |
| 91 | targ-cpu.c: [.config]tc-$(CPU).c |
| 92 | copy $< $@ |
| 93 | targ-cpu.h: [.config]tc-$(CPU).h |
| 94 | copy $< $@ |
| 95 | targ-env.h: [.config]te-generic.h |
| 96 | copy $< $@ |
| 97 | obj-format.h: [.config]obj-$(OBJFORMAT).h |
| 98 | copy $< $@ |
| 99 | obj-format.c: [.config]obj-$(OBJFORMAT).c |
| 100 | copy $< $@ |
| 101 | atof-targ.c: [.config]atof-$(FLTFORMAT).c |
| 102 | copy $< $@ |
| 103 | |
| 104 | targ-cpu.obj: targ-cpu.c targ-cpu.h [.config]atof-vax.c |
| 105 | |
| 106 | [-.bfd]bfd.h: |
| 107 | $(CD) [-.bfd] |
| 108 | gmake -f makefile.vms "CC=$(CC)" |
| 109 | $(CD) [-.gas] |
| 110 | |
| 111 | install: as.exe gasp.exe |
| 112 | $(CP) $^ GNU_ROOT\:[BIN] |
| 113 | |
| 114 | clean: |
| 115 | $$ purge |
| 116 | $(RM) *.obj; |
| 117 | $(RM) *.exe; |
| 118 | $(RM) atof-targ.c; |
| 119 | $(RM) obj-format.c; |
| 120 | $(RM) obj-format.h; |
| 121 | $(RM) targ-env.h; |
| 122 | $(RM) targ-cpu.h; |
| 123 | $(RM) targ-cpu.c; |
| 124 | $(RM) config.status; |