# makefile for "c2man"
# this is for Watcom C32 version 11.0a
# call "wmake -u -f makefile.watcom" to make
# add "debug=1" to get debug version
# add "list=1" to get disassembler listings and mapfiles
#
# you need the GNU tools "byacc" and "flex".
.ERASE
.ERROR
dir /b *.err
# process "debug=1" and "list=1"
!ifdef DEBUG
CFLAGS_DEBUG = -od -d2 -dDEBUG
LFLAGS_DEBUG = DEBUG all
LIST = 1
!else
CFLAGS_OPT = -oneaxh
LFLAGS_OPT = OPTION eliminate,norelocs
!endif
!ifdef LIST
CFLAGS_LIST = -d1
LFLAGS_LIST = OPTION map,verbose,statics,showdead
!endif
# make compiler and linker command lines and rules
CFLAGS = $(CFLAGS_OPT) $(CFLAGS_LIST) $(CFLAGS_DEBUG)
CC = wcc386 -5 -fpi87 -fp5 -wx -zq -wcd=300
COMPILE_c = $(CC) $(CFLAGS)
DISAS_c = wdis -l -s -fi -e -p -o
.c.obj :
$(COMPILE_c) -fh -fi=c2man.h $[@
!ifdef LIST
$(DISAS_c) $@
!endif
LFLAGS = $(LFLAGS_OPT) $(LFLAGS_LIST) $(LFLAGS_DEBUG)
LINKER = wlink SYSTEM nt OPTION quiet,cache,caseexact,stack=1M,heap=1M COMMIT stack=4K,heap=4K
LINK_c = $(LINKER) $(LFLAGS)
YACC = \gnu\bin\H-i386-cygwin32\bin\byacc.exe
LEX = \gnu\bin\H-i386-cygwin32\bin\flex.exe -Cemr
# list of sources
CFILES = c2man.$(EXT) \
string.$(EXT) \
strconcat.$(EXT) \
strappend.$(EXT) \
manpage.$(EXT) \
enum.$(EXT) \
semantic.$(EXT) \
symbol.$(EXT) \
ascii.$(EXT) \
latex.$(EXT) \
nroff.$(EXT) \
texinfo.$(EXT) \
html.$(EXT) \
autodoc.$(EXT) \
getopt.$(EXT)
GENSOURCES = y.tab.c lex.yy.c
EXT = obj
OBJS = $+ $(CFILES) $- y.tab.obj
# how to link
c2man.exe : $(OBJS)
$(LINK_c) NAME $@ FILE { $(OBJS) }
bind -u $@
# dependencies
C2MAN_H = c2man.h config.h symbol.h confmagic.h
c2man.obj : c2man.c $(C2MAN_H) enum.h strconcat.h strappend.h manpage.h output.h patchlevel.h getopt.h makefile.watcom
string.obj : string.c $(C2MAN_H) makefile.watcom
strconcat.obj : strconcat.c $(C2MAN_H) strconcat.h makefile.watcom
strappend.obj : strappend.c $(C2MAN_H) strappend.h makefile.watcom
manpage.obj : manpage.c $(C2MAN_H) manpage.h strconcat.h strappend.h semantic.h output.h makefile.watcom
enum.obj : enum.c $(C2MAN_H) strconcat.h enum.h manpage.h makefile.watcom
semantic.obj : semantic.c $(C2MAN_H) semantic.h enum.h manpage.h strconcat.h output.h makefile.watcom
symbol.obj : symbol.c $(C2MAN_H) symbol.h makefile.watcom
ascii.obj : ascii.c $(C2MAN_H) manpage.h output.h makefile.watcom
latex.obj : latex.c $(C2MAN_H) manpage.h output.h makefile.watcom
nroff.obj : nroff.c $(C2MAN_H) manpage.h output.h makefile.watcom
texinfo.obj : texinfo.c $(C2MAN_H) manpage.h output.h makefile.watcom
html.obj : html.c $(C2MAN_H) manpage.h output.h makefile.watcom
autodoc.obj : autodoc.c $(C2MAN_H) manpage.h output.h makefile.watcom
getopt.obj : getopt.c getopt.h config.h makefile.watcom
# yacc and lex stuff
y.tab.obj : y.tab.c lex.yy.c $(C2MAN_H) semantic.h strconcat.h strappend.h manpage.h enum.h makefile.watcom
$(COMPILE_c) -wcd=202 -wcd=118 -fi=io.h $[@
!ifdef LIST
$(DISAS_c) $@
!endif
lex.yy.c : lex.l makefile.watcom
$(LEX) lex.l
y.tab.c : grammar.y makefile.watcom
@echo Expect 61 shift/reduce conflicts.
$(YACC) grammar.y
# delete object files and other cruft
clean : .SYMBOLIC
for %f in ( $(OBJS) $(GENSOURCES) *.i *.pch *.err *.lst *.map *.pem) do del %f
syntax highlighted by Code2HTML, v. 0.9.1