home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: Product
/
Product.zip
/
sc621_3.zip
/
src
/
Makefile.os2
< prev
next >
Wrap
Makefile
|
1994-03-15
|
7KB
|
244 lines
# Makefile for sc
#
# - for GNU gcc (emx 0.8g kit) [executables for OS/2 2.x or DOS (32-bit)]
# - for Microsoft C 6.00A [executables for OS/2 or MSDOS (16-bit)]
# To use, enter "make -f Makefile.os2" (this makefile depends on its
# name being "Makefile.os2").
#
# Tested with dmake 3.8 and GNU make 3.68 under OS/2
SHELL=/bin/sh
default:
@echo "Enter $(MAKE) -f Makefile.os2 target "
@echo " where 'target' is chosen from "
@echo " msc OS/2 exe [Microsoft C 6.00a] "
@echo " mscbnd OS/2 and DOS exe [Microsoft C 6.00a] "
@echo " mscdos DOS exe [Microsoft C 6.00a] "
@echo " emx OS/2 32-bit exe [EMX/gcc; uses emxlibc.dll] "
@echo " emxbnd OS/2 and DOS 32-bit exe [EMX/gcc] "
msc:
$(MAKE) -f Makefile.os2 all \
CC="cl -nologo -AL" O=".obj" \
CFLAGS="-D__STDC__ -D__OS2__ -UMSDOS" RINT="-DRINT"\
OBJ2="time.obj" \
OBJ3="getopt.obj" \
LDFLAGS="-Lp" \
LIB="setargv.obj lcurses.lib sc.def -link /NOE /st:0x4000"
mscbnd:
$(MAKE) -f Makefile.os2 all \
CC="cl -nologo -AL" O=".obj" \
CFLAGS="-D__STDC__ -D__OS2__" RINT="-DRINT" \
OBJ2="time.obj popen.obj" \
OBJ3="getopt.obj" \
LDFLAGS="-Lp" LBIND="-Fb" \
LIB="setargv.obj lcurses.lib sc.def -link /NOE /st:0x4000" \
BIND="bind sc /n DOSMAKEPIPE DOSCWAIT DOSQFSATTACH"
mscdos:
$(MAKE) -f Makefile.os2 all \
CC="cl -nologo -AL" O=".obj" \
CFLAGS="-D__STDC__" RINT="-DRINT" \
OBJ2="time.obj popen.obj" \
OBJ3="getopt.obj" \
LDFLAGS="-Lr" \
LIB="setargv.obj lcursesr.lib -link /NOE /st:0x4000"
emx:
$(MAKE) -f Makefile.os2 all \
CC="gcc -Zomf -Zmtd -O -s" O=".obj" \
CFLAGS="-D__OS2__" FLOAT_STORE="-ffloat-store" \
LDFLAGS="" \
LIB="-lcurses sc-32.def"
emxbnd:
$(MAKE) -f Makefile.os2 all \
CC="gcc -O -s" O=".o" \
CFLAGS="-D__OS2__ -DMSDOS" FLOAT_STORE="-ffloat-store" \
OBJ2="popen.o" \
LDFLAGS="" \
LIB="-lcurses sc-32.def"
name=sc
NAME=SC
# This is where the library file (tutorial) goes.
#LIBDIR=/usr/local/share/$(name) # reno
LIBDIR=/usr/local/lib/$(name)
# Set DOBACKUPS if you would like a backup copy of a source file on a save
DOBACKUPS=-DDOBACKUPS
# Set SIGVOID if signal routines are type void.
SIGVOID=-DSIGVOID
# Set RINT=-DRINT if you do not have rint() in math.h
#RINT=-DRINT
# Set RE_COMP if you have the re_comp/re_exec regular expression routines
# (most BSD based systems do).
RE_COMP=-DRE_COMP
#RE_COMP=
# Set REGCMP if you have the regcmp/regex regular expression routines
# (most System V based systems do)
#REGCMP=-DREGCMP
#REGCMP=
# This is the name of a pager like "more".
DFLT_PAGER=-DDFLT_PAGER=\"less\"
# this is the name to save back ups in
SAVE=-DSAVENAME=\"$(NAME).bak\"
# path to crypt, do not define if you don't have crypt
#CRYPT=-DCRYPT_PATH=\"c:\mks\os2\mksos2\crypt.exe\"
# If you get errors about fmod being undefined when you try to
# compile, then define NO_FMOD (most likely BSD4.3 and Mt Xinu).
#FMOD=-DNO_FMOD
FMOD=
# If your system doesn't have notimeout() in curses define NONOTIMEOUT
NO_NOTIMEOUT=-DNONOTIMEOUT
# Format of quick reference guide generated by $(name)qref
# Leave undefined for normal text output.
QREF_FMT=
#QREF_FMT=-DTROFF
YACC=bison -y
# MS-DOS needs y_tab instead of the normal y.tab
YTAB=y.tab
# Command to use to make temporary copies of some source files.
LN=cp
#### SYSTEM DEFINES ####
.c$O:
$(CC) $(CFLAGS) -c $<
# All of the source files
SRC= cmds.c crypt.c eres.sed format.c gram.y help.c interp.c \
lex.c psc.c range.c sc.c sc.h screen.c sres.sed version.c \
vi.c vmtbl.c xmalloc.c
# The objects
SCOBJS=cmds$O crypt$O format$O gram$O help$O interp$O lex$O range$O sc$O \
screen$O version$O vi$O vmtbl$O xmalloc$O
OBJS=$(SCOBJS) $(OBJ2) regex$O
# The documents in the Archive
DOCS=CHANGES README sc.doc psc.doc tutorial.sc VMS_NOTES torev build.com
all: $(name).exe p$(name).exe $(name)qref.exe
$(name).exe: $(OBJS)
$(CC) -o $@ ${LDFLAGS} $(OBJS) $(LIB)
$(BIND)
gram.c: gram.y
$(YACC) -d gram.y
mv $(YTAB).c gram.c
$(YTAB).h: gram.y
p$(name).exe: psc.c pvmtbl$O pxmalloc$O $(OBJ3)
$(CC) $(LDFLAGS) $(LBIND) -o $@ psc.c pvmtbl$O pxmalloc$O $(OBJ3) $(LIB)
$(name)qref.exe: qhelp.c sc.h
$(CC) $(LDFLAGS) $(LBIND) -o $@ -DQREF $(QREF_FMT) -DSCNAME=\"$(NAME)\" qhelp.c $(LIB)
pvmtbl.c: vmtbl.c
-rm -f pvmtbl.c
$(LN) vmtbl.c pvmtbl.c
pvmtbl$O: pvmtbl.c sc.h
$(CC) ${CFLAGS} -c -DPSC pvmtbl.c
pxmalloc.c: xmalloc.c
-rm -f pxmalloc.c
$(LN) xmalloc.c pxmalloc.c
# Objects
cmds$O: cmds.c sc.h
$(CC) ${CFLAGS} ${DOBACKUPS} ${CRYPT} -c cmds.c
crypt$O: crypt.c sc.h
$(CC) ${CFLAGS} ${CRYPT} ${DOBACKUPS} -c crypt.c
format$O: format.c
$(CC) ${CFLAGS} -c format.c
help$O: help.c sc.h
$(CC) ${CFLAGS} ${CRYPT} -c help.c
qhelp.c: help.c
-cp -f help.c qhelp.c
interp$O: interp.c sc.h
$(CC) ${CFLAGS} $(FLOAT_STORE) ${IEEE_MATH} ${SIGVOID} ${RINT} ${RE_COMP} ${REGCMP} ${FMOD} -c interp.c
gram$O: sc.h $(YTAB).h gram.c
$(CC) ${CFLAGS} -c gram.c
sed < gram.y > experres.h -f eres.sed
sed < gram.y > statres.h -f sres.sed
lex$O: sc.h $(YTAB).h gram$O lex.c
$(CC) ${CFLAGS} ${SIMPLE} ${IEEE_MATH} ${SIGVOID} ${NO_NOTIMEOUT} -c lex.c
pxmalloc$O: sc.h pxmalloc.c
$(CC) ${CFLAGS} -c -DPSC pxmalloc.c
range$O: range.c sc.h
$(CC) ${CFLAGS} -c range.c
sc$O: sc.h sc.c
$(CC) ${CFLAGS} ${DFLT_PAGER} ${RIGHTBUG} ${SIGVOID} ${SAVE} -c sc.c
screen$O: sc.h screen.c
$(CC) ${CFLAGS} ${BROKENCURSES} ${IDLOKISBAD} ${INTERNATIONAL} ${RIGHTBUG} ${SIGVOID} ${NO_IDLOK} -c screen.c
vi$O: vi.c sc.h
$(CC) ${CFLAGS} -c vi.c
vmtbl$O: vmtbl.c sc.h
$(CC) ${CFLAGS} -c vmtbl.c
xmalloc$O: xmalloc.c sc.h
$(CC) ${CFLAGS} -c xmalloc.c
version$O: xmalloc.c sc.h
$(CC) ${CFLAGS} -c version.c
# other stuff
clean:
rm -f *.obj *.o *.exe *.i *.err *.out
$(name).1: sc.doc
name=$(name) NAME=$(NAME) LIBDIR=$(LIBDIR) sh torev sc.doc > $(name).1
# sed -e s/pname/$(name)/g -e s/PNAME/$(NAME)/g \
# -e s%#LIBDIR#%$(LIBDIR)%g sc.doc > $(name).1
# REVISION=`sed -e '/Revision/!D' -e 's/.*$Revision: 6.21 $(
# sed -e s/pname/$(name)/g -e s/PNAME/$(NAME)/g \
# -e s%#LIBDIR#%$(LIBDIR)%g \
# -e 's/#REVISION#/$(REVISION)/' sc.doc > $(name).1
$(name).man: $(name).1
groff -man $(name).1 > $(name).man
p$(name).1: psc.doc
name=$(name) NAME=$(NAME) LIBDIR=$(LIBDIR) sh torev psc.doc > p$(name).1
# sed -e s/pname/$(name)/g -e s/PNAME/$(NAME)/g psc.doc > p$(name).1
p$(name).man: p$(name).1
groff -man p$(name).1 > p$(name).man