head	1.47;
access;
symbols;
locks
	bsittler:1.47; strict;
comment	@# @;


1.47
date	2002.07.28.23.14.00;	author bsittler;	state Exp;
branches;
next	1.46;

1.46
date	2001.09.07.17.36.43;	author bsittler;	state Exp;
branches;
next	1.45;

1.45
date	2001.08.30.04.58.29;	author bsittler;	state Exp;
branches;
next	1.44;

1.44
date	2001.08.29.05.24.33;	author bsittler;	state Exp;
branches;
next	1.43;

1.43
date	2001.08.28.18.20.49;	author bsittler;	state Exp;
branches;
next	1.42;

1.42
date	2001.08.28.18.01.48;	author bsittler;	state Exp;
branches;
next	1.41;

1.41
date	2001.08.22.06.01.31;	author bsittler;	state Exp;
branches;
next	1.40;

1.40
date	2001.07.30.05.39.52;	author bsittler;	state Exp;
branches;
next	1.39;

1.39
date	2001.07.27.05.44.39;	author bsittler;	state Exp;
branches;
next	1.38;

1.38
date	2001.07.26.19.37.17;	author bsittler;	state Exp;
branches;
next	1.37;

1.37
date	2001.07.26.07.15.17;	author bsittler;	state Exp;
branches;
next	1.36;

1.36
date	2001.07.18.06.24.14;	author bsittler;	state Exp;
branches;
next	1.35;

1.35
date	2001.07.18.05.58.39;	author bsittler;	state Exp;
branches;
next	1.34;

1.34
date	2001.07.17.18.34.00;	author bsittler;	state Exp;
branches;
next	1.33;

1.33
date	2001.07.17.18.28.57;	author bsittler;	state Exp;
branches;
next	1.32;

1.32
date	2001.07.17.06.28.27;	author bsittler;	state Exp;
branches;
next	1.31;

1.31
date	2000.05.07.05.25.39;	author bsittler;	state Exp;
branches;
next	1.30;

1.30
date	2000.04.23.05.47.56;	author bsittler;	state Exp;
branches;
next	1.29;

1.29
date	99.11.04.20.43.25;	author bsittler;	state Exp;
branches;
next	1.28;

1.28
date	99.08.05.07.18.31;	author bsittler;	state Exp;
branches;
next	1.27;

1.27
date	99.08.04.07.31.29;	author bsittler;	state Exp;
branches;
next	1.26;

1.26
date	99.08.04.06.41.37;	author bsittler;	state Exp;
branches;
next	1.25;

1.25
date	99.07.17.00.28.04;	author bsittler;	state Exp;
branches;
next	1.24;

1.24
date	99.07.17.00.01.57;	author bsittler;	state Exp;
branches;
next	1.23;

1.23
date	99.04.06.04.20.33;	author bsittler;	state Exp;
branches;
next	1.22;

1.22
date	99.03.31.22.59.37;	author bsittler;	state Exp;
branches;
next	1.21;

1.21
date	99.03.31.07.27.53;	author bsittler;	state Exp;
branches;
next	1.20;

1.20
date	99.03.31.07.10.57;	author bsittler;	state Exp;
branches;
next	1.19;

1.19
date	98.04.11.07.11.50;	author bsittler;	state Exp;
branches;
next	1.18;

1.18
date	98.03.29.09.37.21;	author bsittler;	state Exp;
branches;
next	1.17;

1.17
date	98.03.29.05.37.34;	author bsittler;	state Exp;
branches;
next	1.16;

1.16
date	98.03.29.05.21.13;	author bsittler;	state Exp;
branches;
next	1.15;

1.15
date	98.03.28.16.10.32;	author bsittler;	state Exp;
branches;
next	1.14;

1.14
date	98.03.28.16.02.07;	author bsittler;	state Exp;
branches;
next	1.13;

1.13
date	98.03.28.15.41.03;	author bsittler;	state Exp;
branches;
next	1.12;

1.12
date	98.03.23.20.01.49;	author bsittler;	state Exp;
branches;
next	1.11;

1.11
date	98.03.23.19.42.01;	author bsittler;	state Exp;
branches;
next	1.10;

1.10
date	98.03.22.23.00.11;	author bsittler;	state Exp;
branches;
next	1.9;

1.9
date	98.03.10.01.46.31;	author bsittler;	state Exp;
branches;
next	1.8;

1.8
date	98.02.12.17.29.23;	author bsittler;	state Exp;
branches;
next	1.7;

1.7
date	98.02.12.06.26.43;	author bsittler;	state Exp;
branches;
next	1.6;

1.6
date	98.02.01.11.02.21;	author bsittler;	state Exp;
branches;
next	1.5;

1.5
date	98.02.01.05.19.03;	author bsittler;	state Exp;
branches;
next	1.4;

1.4
date	98.01.31.15.29.14;	author bsittler;	state Exp;
branches;
next	1.3;

1.3
date	98.01.31.10.41.46;	author bsittler;	state Exp;
branches;
next	1.2;

1.2
date	98.01.31.07.33.23;	author bsittler;	state Exp;
branches;
next	1.1;

1.1
date	98.01.16.06.49.43;	author bsittler;	state Exp;
branches;
next	;


desc
@A Make script to build the SMOKE-16 tools.
@


1.47
log
@Added (commented-out) alternatives for using the "v0"-compatible wrapper scripts
for "as" and "ld", and added the wrapper scripts to RCSOBJS.
@
text
@#
#  smoke16/Makefile - A GNU Make script to build the SMOKE-16 tools.
#  $Revision: 1.46 $
#  Copyright 1997-2001, Benjamin Sittler
#
#  This program is free software; you can redistribute it and/or modify
#  it under the terms of the GNU General Public License as published by
#  the Free Software Foundation; either version 2 of the License, or
#  (at your option) any later version.
#
#  This program is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	 See the
#  GNU General Public License for more details.
#
#  You should have received a copy of the GNU General Public License
#  along with this program; if not, write to the Free Software
#  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#


##
## Host Toolchain Configuration
##

## Host conventional filename suffices
OBJ_SUFFIX=.o
LIB_SUFFIX=.a
EXE_SUFFIX=
#EXE_SUFFIX=.exe
BAK_SUFFIX=~
# Convenient single-letter versions of the common suffices
o=$(OBJ_SUFFIX)
a=$(LIB_SUFFIX)
x=$(EXE_SUFFIX)

## Host C preprocessing flags
CPPFLAGS = -Iinclude

## Host ANSI C/C++ compiler (choose one)

# NOTE: The SMOKE-16 toolset is written in ANSI C, but pains have been
# taken to make sure it is also valid ANSI C++. Compiling using a C++
# compiler rather than a C compiler may improve optimization and help
# find subtle type incompatibilities which would go unnoticed by a
# plain C compiler.

# Option 1: GNU C or C++ compiler (g++ or gcc)
CC = g++
#CC = gcc
CFLAGS = -g -Wall -Werror -O2

# Option 2: Old C or C++ compiler (c++ or cc)
#CC = c++
#CC = cc
#CFLAGS =

# Complete preprocessing and compilation action for option 1 or 2
COMPILE = $(CC) $(CFLAGS) $(CPPFLAGS) -o $@@ -c $<

## Libraries for SMOKE-16 toolchain
LIBS = -Llib -lObj

## Host Linker (choose one)

# Option 1: Link using C/C++ compiler (specified above)
LD = $(CC)
LDFLAGS = $(CFLAGS)

# Option 2: Link using system linker
#LD = ld
#LDFLAGS =

# Complete linking action for option 1 or 2
LINK = $(LD) $(LDFLAGS) -o $@@ $<

## Host Librarian
AR = ar
ARFLAGS =
ARCMD = ru
ARCHIVE = $(AR) $(ARFLAGS) ru $@@

## Host Library Index Generator (choose one)

# Option 1: Use GNU librarian with the 's' command
#RANLIB = ar s $@@

# Option 2: Use old ranlib
RANLIB = ranlib $@@

# Option 3: No separate indexing step required
#RANLIB =

## Host Flex fast lexical analyzer generator
FLEX = flex
FLEXFLAGS =
RUN_FLEX = $(FLEX) $(FLEXFLAGS) -o$@@ $<

## Host GNU Bison compiler-compiler
BISON = bison
BISONFLAGS = -tv
RUN_BISON = $(BISON) $(BISONFLAGS) -o$@@ $<

# Update a file's modification time
TOUCH = touch $@@


##
## SMOKE-16 Toolchain Configuration
##

## SMOKE-16 assembly preprocessor [a.k.a. cpp] (choose one)

# Target Processor Architecture: __SMOKE16 and __SMOKE16__ indicate
# that the target processor architecture is the SMOKE-16; the SMOKE-16
# processor architecture is documented in doc/opcodes.txt. Some useful
# SMOKE-16 macros are defined in <smoke16/asm.h>.

# Target Byte Order: __BIG_ENDIAN__ indicates that each number is
# stored in the target processor's memory with the more significant
# byte at the lower address, and the less significant byte at the
# higher address.

# Target Operating System: __mirrors and __mirrors__ indicate that the
# target operating system provides the Mirrors system call interface;
# the Mirrors system calls are described in <smoke16/syscall.h>.

# Target Naming Conventions: __USER_LABEL_PREFIX__ is defined to _
# (underscore,) indicating that exported symbol names will have an
# underscore prefixed to them. (You may safely ignore warnings about
# the redefinition of this symbol.)

ASP16DEFS = \
           -D__SMOKE16 -D__SMOKE16__ -D__mirrors -D__mirrors__ \
           -D__BIG_ENDIAN__ \
           -D__USER_LABEL_PREFIX__=_ \
           -Iinclude

# Option 1: GNU CPP
ASP16 = gcc -E
ASP16FLAGS = -x assembler-with-cpp -traditional-cpp -undef -nostdinc
ASP16ASSERT = -A- -A 'cpu(smoke16)' -A 'system(mirrors)'
ASPREPROCESS16_DEP =
ASPREPROCESS16 = $(ASP16) $(ASP16FLAGS) $(ASP16DEFS) $(ASP16ASSERT) -o $@@ $<

# Option 2: Old CPP
#ASP16 = cpp
#ASP16FLAGS =
#ASPREPROCESS16_DEP =
#ASPREPROCESS16 = $(ASP16) $(ASP16FLAGS) $(ASP16DEFS) $< $@@

## SMOKE-16 assembler
# Options:
# -A vNUM                 assemble for SMOKE-16 toolset vNUM
# -J                      ignore overflow
# -portable               use portable execution character encoding
# -R                      place read-only data (.rdata) in the text section
#                         (incompatible with split I&D)
# -7 or -r7 or -t6        allow use of reserved register %7/%r7/%t6
AS16 = bin/as
#AS16 = bin.v0/as
#AS16FLAGS = -R
AS16FLAGS =
ASSEMBLE16_DEP = bin/as$x
ASSEMBLE16 = $(AS16) $(AS16FLAGS) -o $@@ $<

## SMOKE-16 linker
# Options:
# -A vNUM                 link for SMOKE-16 toolset vNUM
# -e SYMBOL               set the entry point to SYMBOL (default is '__entry')
# -i or -r                generate relocatable output
# -j or -jmagic           generate split I&D executable (JMAGIC)
# -L DIR                  add DIR to the archive search path
# -l ARCHIVE              link in libARCHIVE.a from the archive search path
# -N or -omagic           generate object or impure executable (OMAGIC)
# -n or -nmagic           generate pure executable (NMAGIC)
# -S                      strip out debugging symbols
# -s                      strip out all symbols
# -Tbss [0x]HEX           set the load address of the BSS section
# -Tdata [0x]HEX          set the load address of the data section
# -T[text] [0x]HEX        set the load address of the text section
# -Z or -lmagic           generate object archive (LMAGIC)
# -1                      process following archives once
# -2                      process following archive list twice
LD16 = bin/ld
#LD16 = bin.v0/ld
#LD16FLAGS =
LD16FLAGS = -j
LD16LIBS = -2 -Llib16 -lc -1
LINK16_DEP = bin/ld$x
LINK16 = $(LD16) $(LD16FLAGS) $(LD16LIBS) -o $@@ $<

## SMOKE-16 librarian
# NOTE: until 'ar' works, we use 'ld -Z'
AR16 = bin/ar
AR16FLAGS =
#ARCHIVE16_DEP = bin/ar$x
#ARCHIVE16 = $(AR16) $(AR16FLAGS) ru $@@
ARCHIVE16_DEP = bin/ld$x
ARCHIVE16 = $(LD16) -Z -o $@@

## SMOKE-16 emulator
# Options:
# -E [0x]HEX              override the entry point
# -M [0x]HEX              set the maximum accessible address
# -N or -numeric          show addresses as numbers
# -S or -symbolic         show addresses as symbols with offsets
# -Tbss [0x]HEX           set the load address of the BSS section
# -Tdata [0x]HEX          set the load address of the data section
# -T[text] [0x]HEX        set the load address of the text section
# -disassemble            show instructions as they are executed
# -trace                  show system calls as they are executed
# -registers              show register contents at every tick
EMU16 = bin/emu
EMU16FLAGS =
EMULATE16_DEP = bin/emu$x
EMULATE16 = $(EMU16) $(EMU16FLAGS) -- $<


##
## Targets
##

OBJS = \
bin/sim$x \
bin/emu$x \
bin/emu--$x \
bin/as$x \
bin/ar$x \
bin/ld$x \
bin/nm$x

SMOKEOBJS = \
bin16/carry bin16/mul bin16/sigill bin16/hello bin16/dump \
bin16/echo bin16/cat bin16/deadbeef bin16/hextest \
bin16/f16

SMOKELIBS = \
lib16/libc.a

LIBCOBJS = \
libc/obj16/_exit.o \
libc/obj16/_sdiv.o \
libc/obj16/_smul.o \
libc/obj16/_udiv.o \
libc/obj16/_umul.o \
libc/obj16/brk.o \
libc/obj16/close.o \
libc/obj16/crt.o \
libc/obj16/fclose.o \
libc/obj16/fgetc.o \
libc/obj16/fopen.o \
libc/obj16/fprintd.o \
libc/obj16/fprintf.o \
libc/obj16/fprintx.o \
libc/obj16/fputc.o \
libc/obj16/fputs.o \
libc/obj16/fscand.o \
libc/obj16/malloc.o \
libc/obj16/open.o \
libc/obj16/perror.o \
libc/obj16/printf.o \
libc/obj16/puts.o \
libc/obj16/raise.o \
libc/obj16/read.o \
libc/obj16/stdio.o \
libc/obj16/strcat.o \
libc/obj16/strcmp.o \
libc/obj16/strcpy.o \
libc/obj16/strlen.o \
libc/obj16/ungetc.o \
libc/obj16/vfprintf.o \
libc/obj16/write.o

RCSOBJS = \
COPYING \
CREDITS \
Makefile \
README \
mkdirs \
mkdirs.bat \
regbfmts \
emucolor \
bin.v0/as \
bin.v0/ld \
include/smoke16/a_out.h \
include/smoke16/fcntl.h \
include/smoke16/asm.h \
src16/carry.s \
src16/deadbeef.s \
src16/f16.s \
src/getopt.c \
include/getopt.h \
src/hashpjw.c \
include/smoke16/hashpjw.h \
src/hashtbl.c \
include/smoke16/hashtbl.h \
src16/hello.s \
src16/echo.s \
src16/cat.s \
src16/dump.s \
src16/hextest.s \
magic \
src16/mul.s \
include/smoke16/regs.h \
src16/sigill.s \
src/sim.c \
src/ar.c \
src/as.c \
src/as_tab.y \
src/as_yy.l \
src/emu.c \
src/emu--.c \
src/ld.c \
src/nm.c \
include/smoke16/libObj.h \
libObj/src/Sym.c \
libObj/src/SymTab.c \
libObj/src/Search.c \
libObj/src/Reloc.c \
libObj/src/TmpFile.c \
libObj/src/Obj.c \
libObj/src/types.c \
libObj/src/a_out.c \
libObj/src/str.c \
libc/src16/_exit.s \
libc/src16/_sdiv.s \
libc/src16/_smul.s \
libc/src16/_udiv.s \
libc/src16/_umul.s \
libc/src16/brk.s \
libc/src16/close.s \
libc/src16/crt.s \
libc/src16/fclose.s \
libc/src16/fgetc.s \
libc/src16/fopen.s \
libc/src16/fprintd.s \
libc/src16/fprintf.s \
libc/src16/fprintx.s \
libc/src16/fputc.s \
libc/src16/fputs.s \
libc/src16/fscand.s \
libc/src16/malloc.s \
libc/src16/open.s \
libc/src16/perror.s \
libc/src16/printf.s \
libc/src16/puts.s \
libc/src16/raise.s \
libc/src16/read.s \
libc/src16/stdio.s \
libc/src16/strcat.s \
libc/src16/strcmp.s \
libc/src16/strcpy.s \
libc/src16/strlen.s \
libc/src16/ungetc.s \
libc/src16/vfprintf.s \
libc/src16/write.s \
include/smoke16/syscall.h \
include/smoke16/types.h \
doc/a_out.txt \
doc/getopt.txt \
doc/opcodes.txt \
doc/portable.txt \
icons/ar.xbm \
icons/ar.xpm \
icons/as.xbm \
icons/as.xpm \
icons/emu.xbm \
icons/emu.xpm \
icons/ld.xbm \
icons/ld.xpm \
icons/nm.xbm \
icons/nm.xpm \
icons/sim.xbm \
icons/sim.xpm \
icons/smoke.xbm \
icons/smoke.xpm \
icons/smoke16.xbm \
icons/smoke16.xpm

LIBOBJ = lib/libObj$a

LIBOBJOBJS = \
libObj/obj/Sym$o \
libObj/obj/SymTab$o \
libObj/obj/Search$o \
libObj/obj/Reloc$o \
libObj/obj/TmpFile$o \
libObj/obj/Obj$o \
libObj/obj/types$o \
libObj/obj/a_out$o \
libObj/obj/str$o

all: $(OBJS) $(SMOKEOBJS) $(LIBOBJ) $(SMOKELIBS)

PHONY = \
all \
update \
checkout \
checkin \
shiny \
clean \
cleaner \
dead \
deader \
distclean \
test \
test1 \
test2 \
test3 \
test4

.PHONY: $(PHONY)

update:
	ci -l $(RCSOBJS)

checkout:
	co -l $(RCSOBJS)

checkin:
	ci $(RCSOBJS)

shiny:
	rm -f core *$(BAK_SUFFIX) */*$(BAK_SUFFIX) */*/*$(BAK_SUFFIX)

clean: shiny
	rm -f libObj/obj/*$o
	rm -f obj/*$o
	rm -f src/as.output src/as_yy.c src/as_tab.c

cleaner: clean
	rm -f $(LIBOBJ) $(LIBOBJOBJS) $(OBJS)

dead: shiny
	rm -f libc/obj16/*.o obj16/*.o
	rm -f libc/src16/*.spp src16/*.spp

deader: dead
	rm -f $(SMOKEOBJS) $(SMOKELIBS)

distclean: cleaner deader

src16/%.s: include/smoke16/syscall.h include/smoke16/asm.h include/smoke16/fcntl.h
	$(TOUCH)

libc/src16/%.s: include/smoke16/syscall.h include/smoke16/asm.h include/smoke16/fcntl.h
	$(TOUCH)

src16/%.spp: src16/%.s $(ASPREPROCESS16_DEP)
	$(ASPREPROCESS16)

obj16/%.o: src16/%.spp $(ASSEMBLE16_DEP)
	$(ASSEMBLE16)

libc/src16/%.spp: libc/src16/%.s $(ASPREPROCESS16_DEP)
	$(ASPREPROCESS16)

libc/obj16/%.o: libc/src16/%.spp $(ASSEMBLE16_DEP)
	$(ASSEMBLE16)

bin16/%: obj16/%.o lib16/libc.a $(LINK16_DEP)
	$(LINK16)

lib16/libc.a: $(LIBCOBJS) $(ARCHIVE16_DEP)
	$(ARCHIVE16) $(LIBCOBJS)

libc/src16/syscall.s: include/smoke16/asm.h include/smoke16/syscall.h
	$(TOUCH)

obj/%$o: src/%.c
	$(COMPILE)

obj/getopt$o: src/getopt.c include/getopt.h
	$(COMPILE)

bin/sim$x: obj/sim$o
	$(LINK)

obj/sim$o: src/sim.c include/smoke16/a_out.h include/smoke16/regs.h
	$(COMPILE)

bin/emu$x: obj/emu$o obj/getopt$o $(LIBOBJ)
	$(LINK) obj/getopt$o $(LIBS)

obj/emu$o: src/emu.c include/smoke16/libObj.h include/getopt.h include/smoke16/fcntl.h include/smoke16/a_out.h include/smoke16/regs.h include/smoke16/syscall.h
	$(COMPILE)

bin/emu--$x: obj/emu--$o
	$(LINK) $(LIBS)

obj/emu--$o: src/emu--.c src/emu.c include/smoke16/libObj.h include/smoke16/fcntl.h include/smoke16/a_out.h include/smoke16/regs.h include/smoke16/syscall.h
	$(COMPILE)

bin/as$x: obj/as$o obj/getopt$o obj/hashpjw$o obj/hashtbl$o $(LIBOBJ)
	$(LINK) obj/getopt$o obj/hashpjw$o obj/hashtbl$o $(LIBS)

include/smoke16/hashtbl.h: include/smoke16/a_out.h
	$(TOUCH)

src/hashtbl.c: include/smoke16/hashtbl.h
	$(TOUCH)

src/hashpjw.c: include/smoke16/hashpjw.h
	$(TOUCH)

src/as.c: include/smoke16/libObj.h
	$(TOUCH)

obj/as$o: src/as.c src/as_tab.c src/as_yy.c include/smoke16/a_out.h include/getopt.h include/smoke16/hashpjw.h include/smoke16/hashtbl.h
	$(COMPILE)

src/as_tab.c: src/as_tab.y $(BISON_SIMPLE) $(BISON_HAIRY)
	$(RUN_BISON)

src/as_yy.c: src/as_yy.l
	$(RUN_FLEX)

bin/ld$x: obj/ld$o obj/getopt$o obj/hashpjw$o $(LIBOBJ)
	$(LINK) obj/getopt$o obj/hashpjw$o $(LIBS)

bin/nm$x: obj/nm$o obj/getopt$o obj/hashpjw$o $(LIBOBJ)
	$(LINK) obj/getopt$o obj/hashpjw$o $(LIBS)

bin/ar$x: obj/ar$o obj/getopt$o obj/hashpjw$o $(LIBOBJ)
	$(LINK) obj/getopt$o obj/hashpjw$o $(LIBS)

include/smoke16/libObj.h: include/smoke16/a_out.h include/smoke16/hashpjw.h
	$(TOUCH)

lib/libObj$a: $(LIBOBJOBJS)
	$(ARCHIVE) $(LIBOBJOBJS)
	$(RANLIB)

libObj/obj/%$o: libObj/src/%.c include/smoke16/libObj.h
	$(COMPILE)

obj/ld$o: src/ld.c include/smoke16/libObj.h include/getopt.h
	$(COMPILE)

obj/nm$o: src/nm.c include/smoke16/libObj.h include/getopt.h
	$(COMPILE)

include/smoke16/a_out.h include/smoke16/regs.h: include/smoke16/types.h
	$(TOUCH)


## SMOKE-16 Testing targets

test: test1 test2 test3 test4

test1: bin16/carry $(EMULATE16_DEP)
	$(EMULATE16)

test2: bin16/mul $(EMULATE16_DEP)
	$(EMULATE16)

test3: bin16/echo $(EMULATE16_DEP)
	$(EMULATE16) "All echo tests completed."

test4: bin16/hello $(EMULATE16_DEP)
	$(EMULATE16)
@


1.46
log
@Removed DEBUG_CRT stuff
@
text
@d3 1
a3 1
#  $Revision: 1.45 $
d161 1
d186 1
d284 2
@


1.45
log
@cleaned up include path
@
text
@d3 1
a3 1
#  $Revision: 1.44 $
d130 2
a131 1
# underscore prefixed to them.
@


1.44
log
@*** empty log message ***
@
text
@d3 1
a3 1
#  $Revision: 1.43 $
d38 1
a38 1
CPPFLAGS = -Iinclude -I. -I-
@


1.43
log
@Added some missing RCSOBJS
@
text
@d3 2
a4 2
#  $Revision: 1.42 $
#  Copyright 1997-2000, Benjamin Sittler
d128 4
d135 1
d138 1
a138 1
# Option 1: GNU C compiler C preprocessor
d140 2
a141 1
ASP16FLAGS = -x assembler-with-cpp -traditional-cpp -undef
d143 1
a143 1
ASPREPROCESS16 = $(ASP16) $(ASP16FLAGS) $(ASP16DEFS) -o $@@ $<
d145 1
a145 1
# Option 2: Old cpp
@


1.42
log
@g++ is once again the default compiler
GNU and old tools have been more clearly separated
Added a note about ANSI C vs. C++ and why we compile our C as C++
Added a note each place multiple tool options are provided
Fixed a typo
Added a note about each symbol we define for ASP16
changed #include "smoke16/foo.h" to #include <smoke16/foo.h>
@
text
@d3 1
a3 1
#  $Revision: 1.41 $
d273 2
d350 1
@


1.41
log
@Added convenient single-letter versions of the common suffices.

Made the default host C compiler be 'cc' instead of 'gcc'.

Grouped tool manufacturer-specific options with their tools.

Changed the RANLIB and ASPREPROCESS16 actions to include $@@.

Made the default SMOKE-16 assembly preprocessor be 'cpp' instead of
'gcc -E'.

Added suffices to the varios SMOKE-16 tool _DEPs.

Included documentation for the emu '-M' option.
@
text
@d2 2
a3 2
#  smoke16/Makefile - A Make script to build the SMOKE-16 tools.
#  $Revision: 1.40 $
d40 10
a49 2
## Host C compiler
#CC = g++
d51 3
a53 1
#CFLAGS = -g -Wall -Werror -O2
d55 4
a58 2
CC = cc
CFLAGS =
d64 3
a66 1
## Host Linker
d69 6
d80 1
d83 6
a88 1
## Host Library index generator
d90 2
a91 1
#RANLIB = ar s $@@
d104 1
a104 1
# Update a file's midification time
d112 17
a128 3
## SMOKE-16 assembly preprocessor (cpp for now...)
ASP16 = cpp
ASP16FLAGS = \
d132 4
d137 5
a141 3
ASPREPROCESS16 = $(ASP16) $(ASP16FLAGS) $< $@@
#ASP16 = gcc -E
#ASP16FLAGS += -x assembler-with-cpp -traditional-cpp -undef
d143 1
a143 1
#ASPREPROCESS16 = $(ASP16) $(ASP16FLAGS) -o $@@ $<
d145 2
a146 1
## SMOKE-16 assembler options
d159 2
a160 1
## SMOKE-16 linker options
d193 2
a194 1
## SMOKE-16 emulator options
@


1.40
log
@added more ld --help output
@
text
@d3 1
a3 1
#  $Revision: 1.39 $
d32 4
d42 2
a43 1
CC = gcc
d45 2
a46 3
#CC = cc
CFLAGS = -g -Wall -Werror -O2
#CFLAGS =
d63 3
a65 3
RANLIB = ranlib
#RANLIB = ar s
#RANLIB = touch
d86 2
a87 2
ASP16 = gcc -E
ASP16FLAGS = -x assembler-with-cpp -traditional-cpp -undef \
d92 5
a96 1
ASPREPROCESS16 = $(ASP16) $(ASP16FLAGS) -o
d108 2
a109 2
ASSEMBLE16_DEP = bin/as
ASSEMBLE16 = $(AS16) $(AS16FLAGS) -o
d132 1
a132 1
LINK16_DEP = bin/ld
d136 1
a136 1
# NOTE: until 'ar' works, we use 'ld' with the '-Z' (LMAGIC) flag
d139 1
a139 1
#ARCHIVE16_DEP = bin/ar
d141 1
a141 1
ARCHIVE16_DEP = bin/ld
d146 1
d157 1
a157 1
EMULATE16_DEP = bin/emu
d166 7
a172 7
bin/sim$(EXE_SUFFIX) \
bin/emu$(EXE_SUFFIX) \
bin/emu--$(EXE_SUFFIX) \
bin/as$(EXE_SUFFIX) \
bin/ar$(EXE_SUFFIX) \
bin/ld$(EXE_SUFFIX) \
bin/nm$(EXE_SUFFIX)
d317 1
a317 1
LIBOBJ = lib/libObj$(LIB_SUFFIX)
d320 9
a328 9
libObj/obj/Sym$(OBJ_SUFFIX) \
libObj/obj/SymTab$(OBJ_SUFFIX) \
libObj/obj/Search$(OBJ_SUFFIX) \
libObj/obj/Reloc$(OBJ_SUFFIX) \
libObj/obj/TmpFile$(OBJ_SUFFIX) \
libObj/obj/Obj$(OBJ_SUFFIX) \
libObj/obj/types$(OBJ_SUFFIX) \
libObj/obj/a_out$(OBJ_SUFFIX) \
libObj/obj/str$(OBJ_SUFFIX)
d364 2
a365 2
	rm -f libObj/obj/*$(OBJ_SUFFIX)
	rm -f obj/*$(OBJ_SUFFIX)
d387 1
a387 1
	$(ASPREPROCESS16) $@@ $<
d390 1
a390 1
	$(ASSEMBLE16) $@@ $<
d393 1
a393 1
	$(ASPREPROCESS16) $@@ $<
d396 1
a396 1
	$(ASSEMBLE16) $@@ $<
d407 1
a407 1
obj/%$(OBJ_SUFFIX): src/%.c
d410 1
a410 1
obj/getopt$(OBJ_SUFFIX): src/getopt.c include/getopt.h
d413 1
a413 1
bin/sim$(EXE_SUFFIX): obj/sim$(OBJ_SUFFIX)
d416 1
a416 1
obj/sim$(OBJ_SUFFIX): src/sim.c include/smoke16/a_out.h include/smoke16/regs.h
d419 2
a420 2
bin/emu$(EXE_SUFFIX): obj/emu$(OBJ_SUFFIX) obj/getopt$(OBJ_SUFFIX) $(LIBOBJ)
	$(LINK) obj/getopt$(OBJ_SUFFIX) $(LIBS)
d422 1
a422 1
obj/emu$(OBJ_SUFFIX): src/emu.c include/smoke16/libObj.h include/getopt.h include/smoke16/fcntl.h include/smoke16/a_out.h include/smoke16/regs.h include/smoke16/syscall.h
d425 1
a425 1
bin/emu--$(EXE_SUFFIX): obj/emu--$(OBJ_SUFFIX)
d428 1
a428 1
obj/emu--$(OBJ_SUFFIX): src/emu--.c src/emu.c include/smoke16/libObj.h include/smoke16/fcntl.h include/smoke16/a_out.h include/smoke16/regs.h include/smoke16/syscall.h
d431 2
a432 2
bin/as$(EXE_SUFFIX): obj/as$(OBJ_SUFFIX) obj/getopt$(OBJ_SUFFIX) obj/hashpjw$(OBJ_SUFFIX) obj/hashtbl$(OBJ_SUFFIX) $(LIBOBJ)
	$(LINK) obj/getopt$(OBJ_SUFFIX) obj/hashpjw$(OBJ_SUFFIX) obj/hashtbl$(OBJ_SUFFIX) $(LIBS)
d446 1
a446 1
obj/as$(OBJ_SUFFIX): src/as.c src/as_tab.c src/as_yy.c include/smoke16/a_out.h include/getopt.h include/smoke16/hashpjw.h include/smoke16/hashtbl.h
d455 2
a456 2
bin/ld$(EXE_SUFFIX): obj/ld$(OBJ_SUFFIX) obj/getopt$(OBJ_SUFFIX) obj/hashpjw$(OBJ_SUFFIX) $(LIBOBJ)
	$(LINK) obj/getopt$(OBJ_SUFFIX) obj/hashpjw$(OBJ_SUFFIX) $(LIBS)
d458 2
a459 2
bin/nm$(EXE_SUFFIX): obj/nm$(OBJ_SUFFIX) obj/getopt$(OBJ_SUFFIX) obj/hashpjw$(OBJ_SUFFIX) $(LIBOBJ)
	$(LINK) obj/getopt$(OBJ_SUFFIX) obj/hashpjw$(OBJ_SUFFIX) $(LIBS)
d461 2
a462 2
bin/ar$(EXE_SUFFIX): obj/ar$(OBJ_SUFFIX) obj/getopt$(OBJ_SUFFIX) obj/hashpjw$(OBJ_SUFFIX) $(LIBOBJ)
	$(LINK) obj/getopt$(OBJ_SUFFIX) obj/hashpjw$(OBJ_SUFFIX) $(LIBS)
d467 1
a467 1
lib/libObj$(LIB_SUFFIX): $(LIBOBJOBJS)
d469 1
a469 1
	$(RANLIB) $@@
d471 1
a471 1
libObj/obj/%$(OBJ_SUFFIX): libObj/src/%.c include/smoke16/libObj.h
d474 1
a474 1
obj/ld$(OBJ_SUFFIX): src/ld.c include/smoke16/libObj.h include/getopt.h
d477 1
a477 1
obj/nm$(OBJ_SUFFIX): src/nm.c include/smoke16/libObj.h include/getopt.h
@


1.39
log
@switched the default compiler back to gcc
@
text
@d3 1
a3 1
#  $Revision: 1.38 $
d105 2
d114 4
d119 1
a119 1
# -2                      process following archives twice
d128 1
d141 1
a141 1
# -Tdata [0x]HEX          set the load address of the text section
@


1.38
log
@the whole toolset now compiles using 'g++ -Wall -Werror'
@
text
@d3 1
a3 1
#  $Revision: 1.37 $
d37 2
a38 2
CC = g++
#CC = gcc
@


1.37
log
@cleaned up build process a lot
@
text
@d3 1
a3 1
#  $Revision: 1.36 $
d30 1
d37 4
a40 1
CC = gcc
d42 1
d61 1
d433 1
a433 1
src/as_tab.c: src/as_tab.y
@


1.36
log
@cleaned up archive rules
@
text
@d3 1
a3 1
#  $Revision: 1.35 $
d37 1
a37 1
CFLAGS = -g -Wall -O2
d81 1
d92 3
a94 1
AS16FLAGS = -R
d109 2
a110 1
LD16FLAGS =
d112 1
d118 1
d120 1
d135 1
d310 19
d364 1
a364 1
src16/%.spp: src16/%.s
d367 1
a367 1
obj16/%.o: src16/%.spp $(AS16)
d370 1
a370 1
libc/src16/%.spp: libc/src16/%.s
d373 1
a373 1
libc/obj16/%.o: libc/src16/%.spp $(AS16)
d376 1
a376 1
bin16/%: obj16/%.o lib16/libc.a $(LD16)
d379 1
a379 1
lib16/libc.a: $(LIBCOBJS) $(LD16)
d466 1
a466 1
test1: bin16/carry $(EMU16)
d469 1
a469 1
test2: bin16/mul $(EMU16)
d472 1
a472 1
test3: bin16/echo $(EMU16)
d475 1
a475 1
test4: bin16/hello $(EMU16)
@


1.35
log
@simplified a bunch of targets
@
text
@d3 1
a3 1
#  $Revision: 1.34 $
d51 1
a51 1
ARCHIVE = $(AR) $(ARFLAGS) ru $@@ $^
d113 2
a114 2
#ARCHIVE16 = $(AR16) $(AR16FLAGS) ru $@@ $^
ARCHIVE16 = $(LD16) -Z -o $@@ $^
d353 1
a353 1
	$(ARCHIVE16)
d419 1
a419 1
	$(ARCHIVE)
@


1.34
log
@Added a few stragglers to RCS
@
text
@d3 1
a3 1
#  $Revision: 1.33 $
d35 5
d43 4
a46 4
## Host C compiler
CC = gcc
CFLAGS = -g -Wall -O2
COMPILE = $(CC) $(CFLAGS) $(CPPFLAGS) -c
d51 1
a51 1
ARCHIVE = $(AR) $(ARFLAGS) ru
d60 1
d65 1
d68 1
a68 1
TOUCH = touch
d108 1
a108 1
LINK16 = $(LD16) $(LD16FLAGS) $(LD16LIBS) -o
d113 2
a114 2
#ARCHIVE16 = $(AR16) $(AR16FLAGS) ru
ARCHIVE16 = $(LD16) -Z -o
d128 1
a128 1
EMULATE16 = $(EMU16) $(EMU16FLAGS) --
d332 1
a332 1
	$(TOUCH) $@@
d335 1
a335 1
	$(TOUCH) $@@
d350 1
a350 1
	$(LINK16) $@@ $<
d353 1
a353 1
	$(ARCHIVE16) $@@ $(LIBCOBJS)
d356 1
a356 1
	$(TOUCH) $@@
d359 1
a359 1
	$(COMPILE) $<
d362 1
a362 1
	$(COMPILE) $<
d365 1
a365 1
	$(LINK) $@@ $<
d368 1
a368 1
	$(COMPILE) $<
d371 1
a371 1
	$(LINK) $@@ $< obj/getopt$(OBJ_SUFFIX) $(LIBS)
d374 1
a374 1
	$(COMPILE) $<
d377 1
a377 1
	$(LINK) $@@ $< $(LIBS)
d380 1
a380 1
	$(COMPILE) $<
d383 1
a383 1
	$(LINK) $@@ $< obj/getopt$(OBJ_SUFFIX) obj/hashpjw$(OBJ_SUFFIX) obj/hashtbl$(OBJ_SUFFIX) $(LIBS)
d386 1
a386 1
	$(TOUCH) $@@
d389 1
a389 1
	$(TOUCH) $@@
d392 1
a392 1
	$(TOUCH) $@@
d395 1
a395 1
	$(TOUCH) $@@
d398 1
a398 1
	$(COMPILE) $<
d401 1
a401 1
	$(BISON) $(BISONFLAGS) -o$@@ $<
d404 1
a404 1
	$(FLEX) $(FLEXFLAGS) -o$@@ $<
d407 1
a407 1
	$(LINK) $@@ $< obj/getopt$(OBJ_SUFFIX) obj/hashpjw$(OBJ_SUFFIX) $(LIBS)
d410 1
a410 1
	$(LINK) $@@ $< obj/getopt$(OBJ_SUFFIX) obj/hashpjw$(OBJ_SUFFIX) $(LIBS)
d413 1
a413 1
	$(LINK) $@@ $< obj/getopt$(OBJ_SUFFIX) obj/hashpjw$(OBJ_SUFFIX) $(LIBS)
d416 1
a416 1
	$(TOUCH) $@@
d419 1
a419 1
	$(ARCHIVE) $@@ $(LIBOBJOBJS)
d423 1
a423 1
	$(COMPILE) $<
d426 1
a426 1
	$(COMPILE) $<
d429 1
a429 1
	$(COMPILE) $<
d432 1
a432 1
	$(TOUCH) $@@
d439 2
a440 2
test1: $(EMU16) bin16/carry
	$(EMULATE16) bin16/carry
d442 2
a443 2
test2: $(EMU16) bin16/mul
	$(EMULATE16) bin16/mul
d445 2
a446 2
test3: $(EMU16) bin16/echo
	$(EMULATE16) bin16/echo "All echo tests completed."
d448 2
a449 2
test4: $(EMU16) bin16/hello
	$(EMULATE16) bin16/hello
@


1.33
log
@added icons to RCSOBJS
@
text
@d3 1
a3 1
#  $Revision: 1.32 $
d180 1
d184 2
@


1.32
log
@cleaned up
@
text
@d3 1
a3 1
#  $Revision: 1.31 $
d259 17
a275 1
doc/portable.txt
d307 1
d313 2
a314 2
	rm -f libc/obj16/*.o
	rm -f obj16/*.o
@


1.31
log
@*** empty log message ***
@
text
@d3 1
a3 1
#  $Revision: 1.30 $
a20 1
SMOKE16_RELEASE = 19990805
d22 5
a26 1
## conventional filename suffices
d32 5
a36 2
## C compiler
CC = gcc -g -Wall -O2 -Iinclude -I. -I- -DSMOKE16_RELEASE=\"$(SMOKE16_RELEASE)\"
d38 4
a41 4
## SMOKE-16 assembly preprocessor (cpp for now...)
ASP = gcc -x assembler-with-cpp -E -undef \
          -D__SMOKE16 -D__SMOKE16__ -D__mirrors -D__mirrors__ \
          -traditional-cpp -Iinclude
d43 1
a43 1
## Librarian
d45 2
d48 3
a50 3
## Library index generator
#RANLIB = ranlib
RANLIB = ar s
d52 1
a52 1
## Flex fast lexical analyzer generator
d54 9
d64 11
a74 2
## GNU Bison compiler-compiler
BISON = bison -tv
d80 2
a81 1
# -R                      place read-only data (.rodata) in the text section
d83 3
a85 1
AS16OPTS = -R
d89 5
d96 31
a126 1
LD16OPTS =
d133 1
d140 1
a140 2
bin16/f16 \
obj16/crt.o
d147 2
d153 1
d158 2
d162 1
d166 1
d171 3
d175 2
a186 1
src16/crt.s \
d205 1
d210 1
d224 2
d230 1
d235 2
d239 1
d243 1
d248 3
d252 2
d261 1
a261 1
LIBS = lib/Obj$(LIB_SUFFIX)
d274 1
a274 1
all: $(OBJS) $(SMOKEOBJS) $(LIBS) $(SMOKELIBS)
d293 1
a293 1
	rm -f $(LIBS) $(LIBOBJOBJS) $(OBJS)
d305 1
a305 1
	touch $@@
d308 1
a308 1
	touch $@@
d311 1
a311 1
	$(ASP) -o $@@ $<
d313 2
a314 2
obj16/%.o: src16/%.spp bin/as$(EXE_SUFFIX)
	bin/as$(EXE_SUFFIX) $(AS16OPTS) -o $@@ $<
d317 1
a317 1
	$(ASP) -o $@@ $<
d319 2
a320 2
libc/obj16/%.o: libc/src16/%.spp bin/as$(EXE_SUFFIX)
	bin/as$(EXE_SUFFIX) $(AS16OPTS) -o $@@ $<
d322 2
a323 2
bin16/%: obj16/%.o obj16/crt.o lib16/libc.a bin/ld$(EXE_SUFFIX)
	bin/ld$(EXE_SUFFIX) $(LD16OPTS) -o $@@ obj16/crt.o $< lib16/libc.a
d325 2
a326 2
lib16/libc.a: $(LIBCOBJS) bin/ld$(EXE_SUFFIX)
	bin/ld$(EXE_SUFFIX) -Z -o $@@ $(LIBCOBJS)
d329 1
a329 1
	touch $@@
d332 1
a332 1
	$(CC) -o $@@ -c $<
d335 1
a335 1
	$(CC) -o $@@ -c $<
d338 1
a338 1
	$(CC) -o $@@ $<
d341 1
a341 1
	$(CC) -o $@@ -c $<
d343 2
a344 2
bin/emu$(EXE_SUFFIX): obj/emu$(OBJ_SUFFIX) obj/getopt$(OBJ_SUFFIX) lib/Obj$(LIB_SUFFIX)
	$(CC) -o $@@ $< obj/getopt$(OBJ_SUFFIX) lib/Obj$(LIB_SUFFIX)
d347 1
a347 1
	$(CC) -o $@@ -c $<
d350 1
a350 1
	$(CC) -o $@@ $< lib/Obj$(LIB_SUFFIX)
d352 2
a353 2
obj/emu--$(OBJ_SUFFIX): src/emu.c include/smoke16/libObj.h include/smoke16/fcntl.h include/smoke16/a_out.h include/smoke16/regs.h include/smoke16/syscall.h
	$(CC) -DEXCLUDE_GETOPT -o $@@ -c $<
d355 2
a356 2
bin/as$(EXE_SUFFIX): obj/as$(OBJ_SUFFIX) obj/getopt$(OBJ_SUFFIX) obj/hashpjw$(OBJ_SUFFIX) obj/hashtbl$(OBJ_SUFFIX) lib/Obj$(LIB_SUFFIX)
	$(CC) -o $@@ $< obj/getopt$(OBJ_SUFFIX) obj/hashpjw$(OBJ_SUFFIX) obj/hashtbl$(OBJ_SUFFIX) lib/Obj$(LIB_SUFFIX)
d359 1
a359 1
	touch $@@
d362 1
a362 1
	touch $@@
d365 1
a365 1
	touch $@@
d368 1
a368 1
	touch $@@
d371 1
a371 1
	$(CC) -o $@@ -c $<
d374 1
a374 1
	$(BISON) -o$@@ $<
d377 4
a380 1
	$(FLEX) -o$@@ $<
d382 2
a383 2
bin/ld$(EXE_SUFFIX): obj/ld$(OBJ_SUFFIX) obj/getopt$(OBJ_SUFFIX) obj/hashpjw$(OBJ_SUFFIX) lib/Obj$(LIB_SUFFIX)
	$(CC) -o $@@ $< obj/getopt$(OBJ_SUFFIX) obj/hashpjw$(OBJ_SUFFIX) lib/Obj$(LIB_SUFFIX)
d385 2
a386 2
bin/nm$(EXE_SUFFIX): obj/nm$(OBJ_SUFFIX) obj/getopt$(OBJ_SUFFIX) obj/hashpjw$(OBJ_SUFFIX) lib/Obj$(LIB_SUFFIX)
	$(CC) -o $@@ $< obj/getopt$(OBJ_SUFFIX) obj/hashpjw$(OBJ_SUFFIX) lib/Obj$(LIB_SUFFIX)
d389 1
a389 1
	touch $@@
d391 2
a392 2
lib/Obj$(LIB_SUFFIX): $(LIBOBJOBJS)
	$(AR) ru $@@ $(LIBOBJOBJS)
d396 1
a396 1
	$(CC) -o $@@ -c $<
d399 1
a399 1
	$(CC) -o $@@ -c $<
d402 1
a402 1
	$(CC) -o $@@ -c $<
d405 4
a408 1
	touch $@@
d412 2
a413 2
test1: bin/emu$(EXE_SUFFIX) bin16/carry
	bin/emu$(EXE_SUFFIX) bin16/carry
d415 2
a416 2
test2: bin/emu$(EXE_SUFFIX) bin16/mul
	bin/emu$(EXE_SUFFIX) bin16/mul
d418 2
a419 2
test3: bin/emu$(EXE_SUFFIX) bin16/echo
	bin/emu$(EXE_SUFFIX) bin16/echo "All echo tests completed."
d421 2
a422 2
test4: bin/emu$(EXE_SUFFIX) bin16/hello
	bin/emu$(EXE_SUFFIX) bin16/hello
@


1.30
log
@libc.o is gone, libc.a is here!
@
text
@d3 1
a3 1
#  $Revision: 1.29 $
d50 13
a62 1
# SMOKE16_STRIP = -s # produce stripped executables (they're smaller)
d145 1
d169 2
a170 1
doc/opcodes.txt
d182 2
a183 1
libObj/obj/a_out$(OBJ_SUFFIX)
d225 1
a225 1
	bin/as$(EXE_SUFFIX) -o $@@ $<
d231 1
a231 1
	bin/as$(EXE_SUFFIX) -o $@@ $<
d234 1
a234 1
	bin/ld$(EXE_SUFFIX) $(SMOKE16_STRIP) -o $@@ obj16/crt.o $< lib16/libc.a
@


1.29
log
@Added f16.
@
text
@d3 2
a4 2
#  $Revision: 1.28 $
#  Copyright 1997-1999, Benjamin Sittler
d64 4
a67 1
obj16/crt.o obj16/libc.o
d70 20
a89 6
obj16/string.o \
obj16/stdio.o \
obj16/malloc.o \
obj16/syscall.o \
obj16/udiv.o \
obj16/umul.o
d95 3
a97 3
include/a_out.h \
include/fcntl.h \
include/asm.h \
d105 1
a105 1
include/hashpjw.h \
d107 1
a107 1
include/hashtbl.h \
d115 1
a115 1
include/regs.h \
d124 1
a124 1
include/libObj.h \
d131 24
a154 8
src16/stdio.s \
src16/malloc.s \
src16/string.s \
include/syscall.h \
src16/syscall.s \
include/types.h \
src16/umul.s \
src16/udiv.s \
d160 1
a160 1
LIBSMOKE16OBJS = \
d167 2
d170 1
a170 1
all: $(OBJS) $(SMOKEOBJS) $(LIBS)
d189 1
a189 1
	rm -f $(LIBS) $(LIBSMOKE16OBJS) $(OBJS)
d192 1
d196 1
a196 1
	rm -f $(SMOKEOBJS)
d200 4
a203 1
src16/%.s: include/syscall.h include/asm.h include/fcntl.h
d212 8
a219 2
bin16/%: obj16/%.o obj16/crt.o obj16/libc.o bin/ld$(EXE_SUFFIX)
	bin/ld$(EXE_SUFFIX) $(SMOKE16_STRIP) -o $@@ obj16/crt.o $< obj16/libc.o
d221 2
a222 2
obj16/libc.o: $(LIBCOBJS) bin/ld$(EXE_SUFFIX)
	bin/ld$(EXE_SUFFIX) -r -o $@@ $(LIBCOBJS)
d224 1
a224 1
src16/syscall.s: include/asm.h include/syscall.h
d231 1
a231 1
	$(CC) -o $@@ -c src/getopt.c
d234 1
a234 1
	$(CC) -o bin/sim$(EXE_SUFFIX) obj/sim$(OBJ_SUFFIX)
d236 2
a237 2
obj/sim$(OBJ_SUFFIX): src/sim.c include/a_out.h include/regs.h
	$(CC) -o $@@ -c src/sim.c
d239 2
a240 2
bin/emu$(EXE_SUFFIX): obj/emu$(OBJ_SUFFIX) obj/getopt$(OBJ_SUFFIX)
	$(CC) -o bin/emu$(EXE_SUFFIX) obj/emu$(OBJ_SUFFIX) obj/getopt$(OBJ_SUFFIX)
d242 2
a243 2
obj/emu$(OBJ_SUFFIX): include/libObj.h include/getopt.h include/fcntl.h src/emu.c include/a_out.h include/regs.h include/syscall.h
	$(CC) -o $@@ -c src/emu.c
d246 1
a246 1
	$(CC) -o bin/emu--$(EXE_SUFFIX) obj/emu--$(OBJ_SUFFIX)
d248 2
a249 2
obj/emu--$(OBJ_SUFFIX): include/libObj.h include/fcntl.h src/emu.c include/a_out.h include/regs.h include/syscall.h
	$(CC) -DEXCLUDE_GETOPT -o $@@ -c src/emu.c
d252 1
a252 1
	$(CC) -o bin/as$(EXE_SUFFIX) obj/as$(OBJ_SUFFIX) obj/getopt$(OBJ_SUFFIX) obj/hashpjw$(OBJ_SUFFIX) obj/hashtbl$(OBJ_SUFFIX) lib/Obj$(LIB_SUFFIX)
d254 2
a255 2
include/hashtbl.h: include/a_out.h
	touch include/hashtbl.h
d257 1
a257 1
src/hashtbl.c: include/hashtbl.h
d260 1
a260 1
src/hashpjw.c: include/hashpjw.h
d263 1
a263 1
src/as.c: include/libObj.h
d266 2
a267 2
obj/as$(OBJ_SUFFIX): src/as.c src/as_tab.c src/as_yy.c include/a_out.h include/getopt.h include/hashpjw.h include/hashtbl.h
	$(CC) -o $@@ -c src/as.c
d270 1
a270 1
	$(BISON) -osrc/as_tab.c src/as_tab.y
d273 1
a273 1
	$(FLEX) -osrc/as_yy.c src/as_yy.l
d276 1
a276 1
	$(CC) -o bin/ld$(EXE_SUFFIX) obj/ld$(OBJ_SUFFIX) obj/getopt$(OBJ_SUFFIX) obj/hashpjw$(OBJ_SUFFIX) lib/Obj$(LIB_SUFFIX)
d279 1
a279 1
	$(CC) -o bin/nm$(EXE_SUFFIX) obj/nm$(OBJ_SUFFIX) obj/getopt$(OBJ_SUFFIX) obj/hashpjw$(OBJ_SUFFIX) lib/Obj$(LIB_SUFFIX)
d281 2
a282 2
include/libObj.h: include/a_out.h include/hashpjw.h
	touch include/libObj.h
d284 2
a285 2
lib/Obj$(LIB_SUFFIX): $(LIBSMOKE16OBJS)
	$(AR) ru $@@ $(LIBSMOKE16OBJS)
d288 1
a288 1
libObj/obj/%$(OBJ_SUFFIX): libObj/src/%.c include/libObj.h
d291 2
a292 2
obj/ld$(OBJ_SUFFIX): src/ld.c include/libObj.h include/getopt.h
	$(CC) -o $@@ -c src/ld.c
d294 2
a295 2
obj/nm$(OBJ_SUFFIX): src/nm.c include/libObj.h include/getopt.h
	$(CC) -o $@@ -c src/nm.c
d297 1
a297 1
include/a_out.h include/regs.h: include/types.h
@


1.28
log
@Updated SMOKE16_RELEASE to 19990805
@
text
@d3 1
a3 1
#  $Revision: 1.27 $
d63 1
d84 1
@


1.27
log
@Updated version string for development version.
@
text
@d3 1
a3 1
#  $Revision: 1.26 $
d21 1
a21 1
SMOKE16_RELEASE = 19990717+
@


1.26
log
@fixed a typo.
@
text
@d3 1
a3 1
#  $Revision: 1.25 $
d21 1
a21 1
SMOKE16_RELEASE = 19990717
@


1.25
log
@Updated release number.
@
text
@d3 1
a3 1
#  $Revision: 1.24 $
d40 1
a40 1
## Lirary index generator
@


1.24
log
@Added emu-- targets.
@
text
@d3 1
a3 1
#  $Revision: 1.23 $
d21 1
a21 1
SMOKE16_RELEASE = 19990405
@


1.23
log
@Updated release number.
@
text
@d3 1
a3 1
#  $Revision: 1.22 $
d55 1
d197 6
@


1.22
log
@Changed release to 19990331 and added doc/a_out.txt to the rcs list.
@
text
@d3 2
a4 2
#  $Revision: 1.21 $
#  Copyright 1997, Benjamin Sittler
d21 1
a21 1
SMOKE16_RELEASE = 19990331
d30 1
a30 1
CC = gcc -Wall -O2 -Iinclude -I. -I- -DSMOKE16_RELEASE=\"$(SMOKE16_RELEASE)\"
@


1.21
log
@Removed magic.be from list of RCS objects.
@
text
@d3 1
a3 1
#  $Revision: 1.20 $
d21 1
a21 1
SMOKE16_RELEASE = 19990330
d56 2
a57 1
bin/ld$(EXE_SUFFIX)
d103 1
d119 1
d224 3
d239 3
@


1.20
log
@Updated release to 19990330
Removed obsolete libObj/src/Lib.c
@
text
@d3 1
a3 1
#  $Revision: 1.19 $
a92 1
magic.be \
@


1.19
log
@Changed the release number.
Explained that the ASP is cpp at this point.
@
text
@d3 1
a3 1
#  $Revision: 1.18 $
d21 1
a21 1
SMOKE16_RELEASE = 19980411
a109 1
libObj/src/Lib.c \
a128 1
libObj/obj/Lib$(OBJ_SUFFIX)
@


1.18
log
@Updated for today's release.
@
text
@d3 1
a3 1
#  $Revision: 1.17 $
d21 1
a21 1
SMOKE16_RELEASE = 19980329
d32 1
a32 1
## SMOKE-16 assembly preprocessor
@


1.17
log
@cleaner target no longer removes the flex and bison output files.
@
text
@d3 1
a3 1
#  $Revision: 1.16 $
d21 1
a21 1
SMOKE16_RELEASE = 19980328
d35 1
a35 1
          -Iinclude
@


1.16
log
@Reversed the meanings of .spp and .s.
@
text
@d3 1
a3 1
#  $Revision: 1.15 $
d151 1
a151 1
	rm -f $(LIBS) $(LIBSMOKE16OBJS) $(OBJS) src/as.output src/as_yy.c src/as_tab.c
@


1.15
log
@Added a prefix for libraries, and reverted to use of -llibname.
@
text
@d3 1
a3 1
#  $Revision: 1.14 $
d23 1
a23 1
## conventional filename prefices and suffices
a24 1
LIB_PREFIX=lib
d30 1
a30 2
#CC = gcc -Wall -O2 -g -Iinclude -I. -I- -Llib
CC = gcc -Wall -O2 -Iinclude -I. -I- -Llib -DSMOKE16_RELEASE=\"$(SMOKE16_RELEASE)\"
d78 1
a78 1
src16/carry.spp \
d80 1
a80 1
src16/deadbeef.spp \
d87 5
a91 5
src16/hello.spp \
src16/echo.spp \
src16/cat.spp \
src16/dump.spp \
src16/hextest.spp \
d94 1
a94 1
src16/mul.spp \
d96 1
a96 1
src16/sigill.spp \
d111 3
a113 3
src16/stdio.spp \
src16/malloc.spp \
src16/string.spp \
d115 1
a115 1
src16/syscall.spp \
d117 2
a118 2
src16/umul.spp \
src16/udiv.spp \
d121 1
a121 1
LIBS = lib/$(LIB_PREFIX)Obj$(LIB_SUFFIX)
d161 1
a161 1
src16/%.spp: include/syscall.h include/asm.h include/fcntl.h
d164 1
a164 1
src16/%.s: src16/%.spp
d167 1
a167 1
obj16/%.o: src16/%.s bin/as$(EXE_SUFFIX)
d176 1
a176 1
src16/syscall.spp: include/asm.h include/syscall.h
d197 2
a198 2
bin/as$(EXE_SUFFIX): obj/as$(OBJ_SUFFIX) obj/getopt$(OBJ_SUFFIX) obj/hashpjw$(OBJ_SUFFIX) obj/hashtbl$(OBJ_SUFFIX) lib/$(LIB_PREFIX)Obj$(LIB_SUFFIX)
	$(CC) -o bin/as$(EXE_SUFFIX) obj/as$(OBJ_SUFFIX) obj/getopt$(OBJ_SUFFIX) obj/hashpjw$(OBJ_SUFFIX) obj/hashtbl$(OBJ_SUFFIX) -lObj
d221 2
a222 2
bin/ld$(EXE_SUFFIX): obj/ld$(OBJ_SUFFIX) obj/getopt$(OBJ_SUFFIX) obj/hashpjw$(OBJ_SUFFIX) lib/$(LIB_PREFIX)Obj$(LIB_SUFFIX)
	$(CC) -o bin/ld$(EXE_SUFFIX) obj/ld$(OBJ_SUFFIX) obj/getopt$(OBJ_SUFFIX) obj/hashpjw$(OBJ_SUFFIX) -lObj
d227 1
a227 1
lib/$(LIB_PREFIX)Obj$(LIB_SUFFIX): $(LIBSMOKE16OBJS)
@


1.14
log
@Updated release number.
@
text
@d3 1
a3 1
#  $Revision: 1.13 $
d23 1
a23 1
## conventional filename suffices
d25 1
d123 1
a123 1
LIBS = lib/libObj$(LIB_SUFFIX)
d199 2
a200 2
bin/as$(EXE_SUFFIX): obj/as$(OBJ_SUFFIX) obj/getopt$(OBJ_SUFFIX) obj/hashpjw$(OBJ_SUFFIX) obj/hashtbl$(OBJ_SUFFIX) lib/libObj$(LIB_SUFFIX)
	$(CC) -o bin/as$(EXE_SUFFIX) obj/as$(OBJ_SUFFIX) obj/getopt$(OBJ_SUFFIX) obj/hashpjw$(OBJ_SUFFIX) obj/hashtbl$(OBJ_SUFFIX) lib/libObj$(LIB_SUFFIX)
d223 2
a224 2
bin/ld$(EXE_SUFFIX): obj/ld$(OBJ_SUFFIX) obj/getopt$(OBJ_SUFFIX) obj/hashpjw$(OBJ_SUFFIX) lib/libObj$(LIB_SUFFIX)
	$(CC) -o bin/ld$(EXE_SUFFIX) obj/ld$(OBJ_SUFFIX) obj/getopt$(OBJ_SUFFIX) obj/hashpjw$(OBJ_SUFFIX) lib/libObj$(LIB_SUFFIX)
d229 1
a229 1
lib/libObj$(LIB_SUFFIX): $(LIBSMOKE16OBJS)
@


1.13
log
@Added suffix macros for DOS compatibility.
@
text
@d3 1
a3 1
#  $Revision: 1.12 $
d21 1
a21 1
SMOKE16_RELEASE = 19980323
@


1.12
log
@Renamed SymSearch.c to Search.c for DOS filename conformance.
@
text
@d3 1
a3 1
#  $Revision: 1.11 $
d23 7
d32 2
d37 2
d40 6
a45 1
RANLIB = ranlib
d47 2
d50 1
d53 5
a57 1
OBJS = bin/sim bin/emu bin/as bin/ld
d122 1
a122 1
LIBS = lib/libObj.a
d125 7
a131 7
libObj/obj/Sym.o \
libObj/obj/SymTab.o \
libObj/obj/Search.o \
libObj/obj/Reloc.o \
libObj/obj/TmpFile.o \
libObj/obj/Obj.o \
libObj/obj/Lib.o
d145 1
a145 1
	rm -f core *~ */*~ */*/*~
d148 2
a149 2
	rm -f libObj/obj/*.o
	rm -f obj/*.o
d168 2
a169 2
obj16/%.o: src16/%.s bin/as
	./bin/as -o $@@ $<
d171 2
a172 2
bin16/%: obj16/%.o obj16/crt.o obj16/libc.o bin/ld
	./bin/ld $(SMOKE16_STRIP) -o $@@ obj16/crt.o $< obj16/libc.o
d174 2
a175 2
obj16/libc.o: $(LIBCOBJS) bin/ld
	./bin/ld -r -o $@@ $(LIBCOBJS)
d180 1
a180 1
obj/%.o: src/%.c
d183 1
a183 1
obj/getopt.o: src/getopt.c include/getopt.h
d186 2
a187 2
bin/sim: obj/sim.o
	$(CC) -o bin/sim obj/sim.o
d189 1
a189 1
obj/sim.o: src/sim.c include/a_out.h include/regs.h
d192 2
a193 2
bin/emu: obj/emu.o obj/getopt.o
	$(CC) -o bin/emu obj/emu.o obj/getopt.o
d195 1
a195 1
obj/emu.o: include/getopt.h include/fcntl.h src/emu.c include/a_out.h include/regs.h include/syscall.h
d198 2
a199 2
bin/as: obj/as.o obj/getopt.o obj/hashpjw.o obj/hashtbl.o lib/libObj.a
	$(CC) -o bin/as obj/as.o obj/getopt.o obj/hashpjw.o obj/hashtbl.o -lObj
d213 1
a213 1
obj/as.o: src/as.c src/as_tab.c src/as_yy.c include/a_out.h include/getopt.h include/hashpjw.h include/hashtbl.h
d222 2
a223 2
bin/ld: obj/ld.o obj/getopt.o obj/hashpjw.o lib/libObj.a
	$(CC) -o bin/ld obj/ld.o obj/getopt.o obj/hashpjw.o -lObj
d228 1
a228 1
lib/libObj.a: $(LIBSMOKE16OBJS)
d232 1
a232 1
libObj/obj/%.o: libObj/src/%.c include/libObj.h
d235 1
a235 1
obj/ld.o: src/ld.c include/libObj.h include/getopt.h
d243 2
a244 2
test1: bin/emu bin16/carry
	./bin/emu bin16/carry
d246 2
a247 2
test2: bin/emu bin16/mul
	./bin/emu bin16/mul
d249 2
a250 2
test3: bin/emu bin16/echo
	./bin/emu bin16/echo "All echo tests completed."
d252 2
a253 2
test4: bin/emu bin16/hello
	./bin/emu bin16/hello
@


1.11
log
@Changed version number to reflect new release.
@
text
@d3 1
a3 1
#  $Revision: 1.10 $
d84 1
a84 1
libObj/src/SymSearch.c \
d104 1
a104 1
libObj/obj/SymSearch.o \
@


1.10
log
@19980322 release, adds -DSMOKE16_RELEASE to CC macro.
@
text
@d3 1
a3 1
#  $Revision: 1.9 $
d21 1
a21 1
SMOKE16_RELEASE = 19980322
@


1.9
log
@Added new files.
@
text
@d3 1
a3 1
#  $Revision: 1.8 $
d21 2
d24 1
a24 1
CC = gcc -Wall -O2 -Iinclude -I. -I- -Llib
@


1.8
log
@shiny now removes core.
@
text
@d3 1
a3 1
#  $Revision: 1.7 $
d36 1
a36 1
bin16/echo bin16/deadbeef bin16/hextest \
d65 1
d69 1
@


1.7
log
@Removed stripping, as symbols are now used by emu for debugging.
@
text
@d3 1
a3 1
#  $Revision: 1.6 $
d118 1
a118 1
	rm -f *~ */*~ */*/*~
@


1.6
log
@Removed cheesy _exists_ stuff.
@
text
@d3 1
a3 1
#  $Revision: 1.5 $
d21 2
a22 2
#CC = gcc -Wall -O2 -g -Iinclude -Llib
CC = gcc -Wall -O2 -Iinclude -Llib
d30 1
a30 1
SMOKE16_STRIP = -s # Uncomment to produce stripped executables (they're smaller)
d39 8
d52 1
d86 1
d135 1
a135 1
src16/%.spp: include/asm.h
d147 2
a148 2
obj16/libc.o: obj16/string.o obj16/stdio.o obj16/syscall.o obj16/udiv.o obj16/umul.o bin/ld
	./bin/ld -r -o $@@ obj16/string.o obj16/stdio.o obj16/syscall.o obj16/udiv.o obj16/umul.o
d168 1
a168 1
obj/emu.o: include/getopt.h src/emu.c include/a_out.h include/regs.h include/syscall.h
@


1.5
log
@Added echo and echo test.
@
text
@d3 1
a3 1
#  $Revision: 1.4 $
d23 3
a25 1
ASP = gcc -x assembler-with-cpp -E -undef -D__SMOKE16 -D__SMOKE16__ -D__mirrors -D__mirrors__ -Iinclude
d30 1
a30 3
SMOKE16_STRIP = # -s # Uncomment to produce stripped executables (they're smaller)

DIREXISTS = _exists_
d35 2
a36 1
bin16/carry bin16/mul bin16/sigill bin16/hello bin16/dump bin16/echo bin16/deadbeef bin16/hextest \
d131 1
a131 1
obj16/%.o: src16/%.s bin/as obj16/$(DIREXISTS)
d134 1
a134 1
bin16/%: obj16/%.o obj16/crt.o obj16/libc.o bin/ld bin16/$(DIREXISTS)
d137 1
a137 1
obj16/libc.o: obj16/string.o obj16/stdio.o obj16/syscall.o obj16/udiv.o obj16/umul.o bin/ld obj16/$(DIREXISTS)
d143 1
a143 1
obj/%.o: src/%.c obj/$(DIREXISTS)
d146 1
a146 1
obj/getopt.o: src/getopt.c include/getopt.h obj/$(DIREXISTS)
d149 1
a149 1
bin/sim: obj/sim.o bin/$(DIREXISTS)
d152 1
a152 1
obj/sim.o: src/sim.c include/a_out.h include/regs.h obj/$(DIREXISTS)
d155 1
a155 1
bin/emu: obj/emu.o obj/getopt.o bin/$(DIREXISTS)
d158 1
a158 1
obj/emu.o: include/getopt.h src/emu.c include/a_out.h include/regs.h include/syscall.h obj/$(DIREXISTS)
d161 1
a161 1
bin/as: obj/as.o obj/getopt.o obj/hashpjw.o obj/hashtbl.o bin/$(DIREXISTS) lib/libObj.a
d176 1
a176 1
obj/as.o: src/as.c src/as_tab.c src/as_yy.c include/a_out.h include/getopt.h include/hashpjw.h include/hashtbl.h obj/$(DIREXISTS)
d185 1
a185 1
bin/ld: obj/ld.o obj/getopt.o obj/hashpjw.o lib/libObj.a bin/$(DIREXISTS)
d191 1
a191 1
lib/libObj.a: $(LIBSMOKE16OBJS) lib/$(DIREXISTS)
d195 1
a195 1
libObj/obj/%.o: libObj/src/%.c include/libObj.h libObj/obj/$(DIREXISTS)
d198 1
a198 1
obj/ld.o: src/ld.c include/libObj.h include/getopt.h obj/$(DIREXISTS)
a216 3

%/$(DIREXISTS):
	sh -c "./mkparent $@@ && touch $@@"
@


1.4
log
@Added target for dump.
@
text
@d3 1
a3 1
#  $Revision: 1.3 $
d35 1
a35 1
bin16/carry bin16/mul bin16/sigill bin16/hello bin16/dump bin16/deadbeef bin16/hextest \
d54 1
d203 1
a203 1
test: test1 test2 test3
d211 4
a214 1
test3: bin/emu bin16/hello
@


1.3
log
@*** empty log message ***
@
text
@d3 1
a3 1
#  $Revision: 1.2 $
d35 1
a35 1
bin16/carry bin16/mul bin16/sigill bin16/hello bin16/deadbeef bin16/hextest \
d54 1
@


1.2
log
@Added udiv stuff.
@
text
@d3 1
a3 1
#  $Revision: 1.1 $
d28 1
a28 1
SMOKE16_STRIP = -s # Uncomment to produce stripped executables (they're smaller)
@


1.1
log
@Initial revision
@
text
@d3 1
a3 1
#  $Revision: 1.46 $
d79 1
d134 2
a135 2
obj16/libc.o: obj16/string.o obj16/stdio.o obj16/syscall.o obj16/umul.o bin/ld obj16/$(DIREXISTS)
	./bin/ld -r -o $@@ obj16/string.o obj16/stdio.o obj16/syscall.o obj16/umul.o
@
