Annotation of gforth/makefile.dos, revision 1.3

1.1       pazsan      1: #Copyright 1992 by the ANSI figForth Development Group
1.3     ! pazsan      2: # To change the values of `make' variables: instead of editing Makefiles,
        !             3: # (1) if the variable is set in `config.status', edit `config.status'
        !             4: #     (which will cause the Makefiles to be regenerated when you run `make');
        !             5: # (2) otherwise, pass the desired values on the `make' command line.
        !             6: 
        !             7: #To do:
        !             8: #use $(srcdir) to make compilation in a non-srcdir possible
        !             9: 
        !            10: VERSION        =0.1alpha#gforth version
        !            11: SHELL  = command.com
        !            12: RM     = del
1.1       pazsan     13: CP     = copy
1.3     ! pazsan     14: INSTALL        = install-sh
        !            15: INSTALL_PROGRAM = install-sh
        !            16: INSTALL_DATA = install-sh
        !            17: LN_S   = copy
1.1       pazsan     18: GCC    = gcc
                     19: FORTH  = gforth
                     20: CC     = gcc
1.2       pazsan     21: MAKE   = make
1.3     ! pazsan     22: TEXI2DVI = tex
        !            23: DVI2PS = dvips
        !            24: MAKEINFO = makeinfo
        !            25: XCFLAGS        = 
        !            26: XDEFINES = -DDIRECT_THREADED
        !            27: SWITCHES = $(XCFLAGS) $(XDEFINES) #-DNDEBUG #turn off assertions
        !            28: ENGINE_FLAGS =  -fforce-mem -fforce-addr -fomit-frame-pointer -fno-defer-pop -fcaller-saves
1.1       pazsan     29: CFLAGS = -g -O4 -Wall $(SWITCHES)
                     30: 
                     31: #John Wavrik should use -Xlinker -N to get a writable text (executable)
1.3     ! pazsan     32: LDFLAGS        = -g
        !            33: LDLIBS = -lm -lpc
        !            34: 
        !            35: prefix = .\
        !            36: exec_prefix = .\
        !            37: srcdir = .\
        !            38: bindir = $(exec_prefix)\bin
        !            39: #read-only architecture-independent files
        !            40: datadir = $(prefix)\share
        !            41: #read-only architecture-dependent non-ascii files
        !            42: libdir = $(prefix)\lib
        !            43: infodir = $(prefix)\info
        !            44: mandir = $(prefix)\man\man1
1.1       pazsan     45: 
                     46: 
1.2       pazsan     47: INCLUDES = forth.h io.h
1.1       pazsan     48: 
1.2       pazsan     49: FORTH_SRC = add.fs assert.fs ansi.fs blocks.fs bufio.fs checkans.fs \
                     50:        colorize.fs cross.fs debug.fs debugging.fs doskey.fs ds2texi.fs \
                     51:        dumpimage.fs environ.fs errore.fs etags.fs extend.fs filedump.fs \
                     52:        float.fs glocals.fs glosgen.fs gray.fs hash.fs history.fs \
1.3     ! pazsan     53:        kernal.fs locals-test.fs look.fs main.fs \
        !            54:        mach16b.fs mach16l.fs mach32b.fs mach32l.fs mach64b.fs mach64l.fs \
1.2       pazsan     55:        other.fs prims2x.fs random.fs search-order.fs see.fs sieve.fs \
                     56:        startup.fs struct.fs tools.fs toolsext.fs tt.fs vars.fs vt100.fs \
                     57:        vt100key.fs wordinfo.fs wordsets.fs
                     58: 
1.3     ! pazsan     59: SOURCES        = Makefile.in configure.in configure config.sub  config.guess \
        !            60:        install-sh INSTALL README ToDo BUGS model copying gforth.ds \
1.2       pazsan     61:        primitives engine.c main.c io.c \
1.3     ! pazsan     62:        m68k.h mips.h 386.h hppa.h cache.c sparc.h power.h alpha.h 32bit.h \
        !            63:        getopt.c getopt1.c getopt.h select.c \
        !            64:        ecvt.c memcmp.c strtol.c strtoul.c memmove.c \
        !            65:        makefile.dos configure.bat startup.dos \
1.2       pazsan     66:        glosgen.glo glossaries.doc \
                     67:        $(INCLUDES) $(FORTH_SRC)
1.1       pazsan     68: 
1.2       pazsan     69: RCS_FILES =  ToDo model high-level
1.1       pazsan     70: 
                     71: GEN = gforth
                     72: 
1.3     ! pazsan     73: OBJECTS        = engine.o main.o ecvt.o select.o getopt.o getopt1.o
1.1       pazsan     74: 
                     75: # things that need a working forth system to be generated
                     76: # this is used for antidependences,
1.2       pazsan     77: 
1.3     ! pazsan     78: FORTH_GEN =  primitives.b primitives.i prim_labels.i aliases.fs kernl16l.fi kernl16b.fi kernl32l.fi kernl32b.fi kernl64l.fi kernl64b.fi
        !            79: 
        !            80: GEN_PRECIOUS = $(FORTH_GEN) gforth.texi gforth.dvi gforth.ps Makefile configure
1.1       pazsan     81: 
1.3     ! pazsan     82: #standards.info recommends this:
        !            83: .SUFFIXES:
        !            84: .SUFFIXES: .c .o
1.2       pazsan     85: 
1.1       pazsan     86: all:
1.3     ! pazsan     87:        -if not exist gforth.exe $(MAKE) first
1.1       pazsan     88:        $(MAKE) more
                     89: 
                     90: first: gforth
                     91: 
                     92: more:  $(FORTH_GEN) gforth
                     93: 
                     94: #from the gcc Makefile: 
                     95: #"Deletion of files made during compilation.
                     96: # There are four levels of this:
                     97: #   `mostlyclean', `clean', `distclean' and `realclean'.
                     98: # `mostlyclean' is useful while working on a particular type of machine.
                     99: # It deletes most, but not all, of the files made by compilation.
                    100: # It does not delete libgcc.a or its parts, so it won't have to be recompiled.
                    101: # `clean' deletes everything made by running `make all'.
                    102: # `distclean' also deletes the files made by config.
                    103: # `realclean' also deletes everything that could be regenerated automatically."
                    104: 
                    105: clean:         
                    106:                -$(RM) $(GEN) *.o *.s
                    107: 
                    108: distclean:     clean
1.3     ! pazsan    109:                -$(RM) machine.h gforth.fi config.cache config.log
1.1       pazsan    110: 
                    111: realclean:     distclean
                    112:                -$(RM) $(GEN_PRECIOUS)
                    113: 
1.3     ! pazsan    114: dist:          $(SOURCES) $(FORTH_GEN)
        !           115:                -$(RM) gforth-$(VERSION)
        !           116:                ln -s `pwd` gforth-$(VERSION)
1.2       pazsan    117:                echo "" $(SOURCES) $(FORTH_GEN) |\
                    118:                        sed -e 's| | gforth-$(VERSION)/|g' |\
1.3     ! pazsan    119:                        xargs tar cvf gforth-$(VERSION).tar
1.2       pazsan    120:                gzip -9 -f gforth-$(VERSION).tar
1.3     ! pazsan    121:                -$(RM) gforth-$(VERSION)
1.2       pazsan    122: 
1.3     ! pazsan    123: install:       gforth $(FORTH_SRC) gforth.fi gforth.1 gforth.info
        !           124:                $(INSTALL) -d $(bindir) $(mandir) $(infodir) $(libdir)/gforth $(datadir)/gforth 
        !           125:                $(INSTALL_PROGRAM) gforth $(bindir)
        !           126:                $(INSTALL_DATA) gforth.1 $(mandir)
        !           127:                $(INSTALL_DATA) gforth.info* $(infodir)
        !           128:                $(INSTALL_DATA) gforth.fi $(libdir)/gforth
        !           129:                for i in $(FORTH_SRC); do \
        !           130:                        $(CP) $$i $(datadir)/gforth; \
        !           131:                        $(LN_S) $(datadir)/gforth/$$i $(libdir)/gforth \
        !           132:                done
        !           133:                
        !           134: dvi:           gforth.dvi
1.1       pazsan    135: 
                    136: gforth:        $(OBJECTS)
                    137:                -$(CP) gforth gforth~
                    138:                $(GCC) $(LDFLAGS) $(OBJECTS) $(LDLIBS) -o $@
1.3     ! pazsan    139:                strip gforth
1.1       pazsan    140:                coff2exe gforth
                    141: 
1.3     ! pazsan    142: kernl16l.fi:   main.fs search-order.fs cross.fs aliases.fs vars.fs add.fs \
        !           143:                errore.fs kernal.fs extend.fs tools.fs toolsext.fs \
        !           144:                mach16l.fs $(FORTH_GEN)
        !           145:                -$(CP) kernl16l.fi kernl16l.fi~
        !           146:                $(FORTH) -e 's" mach16l.fs"' main.fs
        !           147:                
        !           148: 
        !           149: kernl16b.fi:   main.fs search-order.fs cross.fs aliases.fs vars.fs add.fs \
        !           150:                errore.fs kernal.fs extend.fs tools.fs toolsext.fs \
        !           151:                mach16b.fs $(FORTH_GEN)
        !           152:                -$(CP) kernl16b.fi kernl16b.fi~
        !           153:                $(FORTH) -e 's" mach16b.fs"' main.fs
        !           154:                
        !           155: 
1.1       pazsan    156: kernl32l.fi:   main.fs search-order.fs cross.fs aliases.fs vars.fs add.fs \
                    157:                errore.fs kernal.fs extend.fs tools.fs toolsext.fs \
                    158:                mach32l.fs $(FORTH_GEN)
                    159:                -$(CP) kernl32l.fi kernl32l.fi~
                    160:                $(FORTH) -e 's" mach32l.fs"' main.fs
1.2       pazsan    161:                $(CP) kernl32l.fi gforth.fi
1.1       pazsan    162: 
                    163: kernl32b.fi:   main.fs search-order.fs cross.fs aliases.fs vars.fs add.fs \
                    164:                errore.fs kernal.fs extend.fs tools.fs toolsext.fs \
                    165:                mach32b.fs $(FORTH_GEN)
                    166:                -$(CP) kernl32b.fi kernl32b.fi~
                    167:                $(FORTH) -e 's" mach32b.fs"' main.fs
1.3     ! pazsan    168:                
        !           169: 
        !           170: kernl64l.fi:   main.fs search-order.fs cross.fs aliases.fs vars.fs add.fs \
        !           171:                errore.fs kernal.fs extend.fs tools.fs toolsext.fs \
        !           172:                mach64l.fs $(FORTH_GEN)
        !           173:                -$(CP) kernl64l.fi kernl64l.fi~
        !           174:                $(FORTH) -e 's" mach64l.fs"' main.fs
        !           175:                
1.1       pazsan    176: 
1.3     ! pazsan    177: kernl64b.fi:   main.fs search-order.fs cross.fs aliases.fs vars.fs add.fs \
        !           178:                errore.fs kernal.fs extend.fs tools.fs toolsext.fs \
        !           179:                mach64b.fs $(FORTH_GEN)
        !           180:                -$(CP) kernl64b.fi kernl64b.fi~
        !           181:                $(FORTH) -e 's" mach64b.fs"' main.fs
        !           182:                
1.2       pazsan    183: 
1.1       pazsan    184: engine.s:      engine.c primitives.i prim_labels.i machine.h $(INCLUDES)
1.3     ! pazsan    185:                $(GCC) $(CFLAGS) $(ENGINE_FLAGS) -S engine.c
1.1       pazsan    186: 
                    187: engine.o:      engine.c primitives.i prim_labels.i machine.h $(INCLUDES)
1.3     ! pazsan    188:                $(GCC) $(CFLAGS) $(ENGINE_FLAGS) -c engine.c
        !           189: 
        !           190: strtoul.o:     strtoul.c strtol.c
1.1       pazsan    191: 
                    192: primitives.b:  primitives
                    193:                m4 primitives >$@ 
                    194: 
                    195: primitives.i : primitives.b prims2x.fs
                    196:                $(FORTH) prims2x.fs -e "s\" primitives.b\" ' output-c process-file bye" >$@
                    197: 
                    198: prim_labels.i :        primitives.b prims2x.fs
                    199:                $(FORTH) prims2x.fs -e "s\" primitives.b\" ' output-label process-file bye" >$@
                    200: 
                    201: aliases.fs:    primitives.b prims2x.fs
                    202:                $(FORTH) prims2x.fs -e "s\" primitives.b\" ' output-alias process-file bye" >$@
                    203: 
                    204: primitives.fs: primitives.b prims2x.fs
                    205:                $(FORTH) prims2x.fs -e "s\" primitives.b\" ' output-forth process-file bye" >$@
                    206: 
                    207: gforth.texi:   gforth.ds primitives.b ds2texi.fs prims2x.fs
                    208:                $(FORTH) ds2texi.fs >$@
                    209: 
                    210: gforth.dvi:    gforth.texi
1.3     ! pazsan    211:                $(TEXI2DVI) gforth.texi
1.1       pazsan    212: 
1.2       pazsan    213: gforth.ps:     gforth.dvi
1.3     ! pazsan    214:                $(DVI2PS) gforth.dvi -o $@
        !           215: 
        !           216: gforth.info:   gforth.texi
        !           217:                -$(MAKEINFO) gforth.texi
1.1       pazsan    218: 
1.3     ! pazsan    219: # For an explanation of the following Makefile rules, see node
        !           220: # `Automatic Remaking' in GNU Autoconf documentation.
        !           221: Makefile: Makefile.in config.status
        !           222:        CONFIG_FILES=$@ CONFIG_HEADERS= ./config.status
        !           223: config.status: configure
        !           224:        ./config.status --recheck
        !           225: configure: configure.in
        !           226:        cd $(srcdir) && autoconf
        !           227: 
        !           228: #unnecessary and does not work with all makes
        !           229: #%.s :         %.c $(INCLUDES)
        !           230: #              $(CC) $(CFLAGS) -S $< -o $@
1.1       pazsan    231: 
1.3     ! pazsan    232: #%.o :         %.s
        !           233: #              $(CC) $(CFLAGS) -c $< -o $@
1.1       pazsan    234: 

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>