home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 11 Util
/
11-Util.zip
/
file39a.zip
/
src
/
Makefile.os2
< prev
next >
Wrap
Makefile
|
1993-07-31
|
4KB
|
121 lines
# Makefile for "file" (tested with dmake 3.8) 6 April 1993
#
# - for GNU gcc (emx kit) under OS/2 2.0 (32-bit)
# - for Microsoft C 6.00 under OS/2 or MSDOS (16-bit)
# To use, enter "{d,n}make -f makefile.os2" (this makefile depends on its
# name being "makefile.os2").
# Notes on Microsoft C 6.00A compilation:
# The msc target creates an OS/2-only executable with additional features
# over the mscdos version. Notes from the unzip package suggest that
# a larger stack has to be used for OS/2 because system calls use more
# stack than under DOS; 8k is recommended by Microsoft.
default:
@echo Enter "$(MAKE) -f makefile.os2 emx"
@echo or "$(MAKE) -f makefile.os2 msc"
@echo or "$(MAKE) -f makefile.os2 mscdos"
emx:
$(MAKE) -f makefile.os2 all \
CC="gcc -Zomf -Zmtd" O=".obj" \
CFLAGS="-DOS2 -DEMX" \
LDFLAGS="" \
LDFLAGS2="" \
OBJS2="" \
DEF="file-32.def"
msc:
$(MAKE) -f makefile.os2 all \
CC="cl -nologo -AC" O=".obj" \
CFLAGS="-D__STDC__ -DOS2 -DMSC -UMSDOS" \
LDFLAGS="-Lp -F 4000" \
LDFLAGS2="setargv.obj -link /NOE" \
OBJS2="getopt$$O _getname$$O" \
DEF="file.def"
mscdos:
$(MAKE) -f makefile.os2 all \
CC="cl -nologo -AC" O=".obj" \
CFLAGS="-D__STDC__ -DOS2 -DMSC -DNO_PIPE" \
LDFLAGS="-Lr -F 4000" \
LDFLAGS2="setargv.obj -link /NOE" \
OBJS2="getopt$$O _getname$$O" \
DEF=""
MAGIC = /etc/magic
MANCDIR = /etc/man/man1
MANCEXT = 1
MANFDIR = /etc/man/man4
MANFEXT = 4
# There are no system-dependant configuration options (except maybe CFLAGS).
# Uncomment any of these that is missing from your "standard" library.
LOCALSRCS = # localsrc/getopt.c localsrc/strtol.c \
# localsrc/strtok.c localsrc/strchr.c
LOCALOBJS = # localsrc/getopt$O localsrc/strtol$O \
# localsrc/strtok$O localsrc/strchr$O
# These are not compiled in unless you use -Ilocalinc, but
# are not commented out as "make dist" &c use them.
LOCALINC = localinc/*.h localinc/sys/*.h
.c$O :
$(CC) $(CFLAGS) -c $<
SRCS = file.c apprentice.c fsmagic.c softmagic.c ascmagic.c \
compress.c is_tar.c \
print.c $(LOCALSRCS) $(LOCALINC) apptype.c _getname.c
OBJS = file$O apprentice$O fsmagic$O softmagic$O ascmagic$O \
compress$O is_tar$O \
print$O $(LOCALOBJS) apptype$O $(OBJS2)
ALLSRC = LEGAL.NOTICE README MAINT PORTING $(SRCS) *.h \
Makefile file.1s magic.4s localsrc/*.c tst/Makefile
ALLMAGIC = Magdir/Makefile Magdir/Localstuff Magdir/Header Magdir/[a-z]*
all: file.exe magic
TESTFILES = * tst/*
try: all $(OFILE)
cd tst; make
time $(OFILE) $(TESTFILES) >/tmp/t1 # can't use ./magic
time ./file -m ./magic $(TESTFILES) >/tmp/t2
-diff -b /tmp/t[12]
what ./file >lastnocore
file.exe : $(OBJS) $(DEF)
$(CC) $(LDFLAGS) -o $@ $< $(LDFLAGS2)
magic: Magdir
# Magdir/Makefile's "install" mv's magic to here for testing.
[
cd Magdir
make install
]
ascmagic$O: names.h
apprentice$O ascmagic$O file$O fsmagic$O print$O softmagic$O: file.h
install: file.exe magic file.1 magic.4 $(BINDIR) $(MANCDIR) $(MANFDIR)
cp file $(BINDIR)/file
cp magic $(MAGIC)
cp file.1 $(MANCDIR)/file.$(MANCEXT)
cp magic.4 $(MANFDIR)/magic.$(MANFEXT)
file.1 magic.4 : file.1s magic.4s Makefile.os2
sed -e s,__MAGIC__,$(MAGIC),g -e s,__SECTION__,$(MANFEXT),g $@s > $@
clean:
rm -f *$O core file.exe magic lint dist.* MANIFEST lastnocore
clobber:
cd tst; make clean
tar: $(ALLSRC) $(ALLMAGIC)
tar cvf /dev/rfd0a $(ALLSRC) $(ALLMAGIC)