📄 makefile.unx
字号:
# -----------------------------------------------------------------------------# Unix makefile for compiling and testing the # unsupported utilities of the UGST distribution. # - x{en,de}code: xencode/xdecode uuencode/uudecode improved # programs: compile with make xe xd test-xed# - cf,df: compare/dump programs compfile.c, dumpfile.c# - add/sub: executables to generate reports by adding or # subtracting the contents of two files. They are both # generated from the source code file add-sub.c, depending # on how it is compiled.# - sb: byte-swap 16-bit words with program sb.c# - measure.c: statistical measurement tool measure.c to# report max,min,DC,AC, and 16-bit CRCs for files# - sine: sine wave generation# - oper: arithmetic operation over two files (+,-,/,*)# - chr2sh,sh2chr: conversion between byte-oriented and 16-bit # word oriented bitstream files.# - bin2asc,asc2bin: conversion between ascii and binary file formats# - endian: tells the endian type for the target computer# - crc: 32-bit CRC calculations# - fdelay: flexible delay line program# - concat: concatenate files in binary mode.## *************************************************************************# WARNING:# NOT ALL PROGRAMS HAVE BEEN THROROUGLY TESTED IN ALL THE "PREFERRED" # PLATFORMS!!# *************************************************************************## Implemented by <simao@ctd.comsat.com> -- 15.Jan.95# Revised - # 21.Aug.95 - Added new stuff# 18.Sep.95 - Adding external control for user email in x*code, # see make variable WHO below. # -----------------------------------------------------------------------------CC=gcc#CC_OPT = -I../utl -g -Wall # for gccCC_OPT=-I../utl -g # For SunOS and ccWHO=-DUSER_NAME="\"[simao@ctd.comsat.com]\"" # Define your email here#RM=rm -fRUN=XE=$(RUN) ./xencodeXD=$(RUN) ./xdecode# ----------------------------------------------------------------------# Targets and test files# ----------------------------------------------------------------------EXE=add astrip asc2bin bin2asc cf chr2sh concat crc df endian fdelay measure \ oper sb sh2chr sine sub xdecode xencodeREF_XED=voice.uue voice01.uue printme.eps printme.uueREF_SB=bigend.src litend.srcREF_DELAY=delay-15.ref delay-a.ref delay-u.ref delaydft.ref delayfil.refTST_DELAY=delay-15.tst delay-0f.tst delay-a.tst delay-u.tst delaydft.tst \ delayfil.tstREF_CF=cftest1.dat cftest2.dat cftest3.datTST_ASTRIP=astrip.smp astrip.blk astrip.inpREF_ASTRIP=astrip.refREF_CONCAT=concat1.txt concat2.txt concat3.txtTST_CONCAT=concat3.tst undo.txt# ----------------------------------------------------------------------# Tailor to your availability# ----------------------------------------------------------------------#UNZIP=pkunzip # for shareware pkunzip programUNZIP=unzip -o # if public domain unzip -o availableDIFF=diff # if Unix diff is available# ----------------------------------------------------------------------# General rules# ----------------------------------------------------------------------.c.o: $(CC) $(CC_OPT) -c $< # ----------------------------------------------------------------------# Macro rules# ----------------------------------------------------------------------all: $(EXE)anyway: clean allclean: $(RM) *.ocleantest: $(RM) voice.rec v.uue v01.uue printme.ps print_me.uue *.tst $(RM) $(REF_XED) $(REF_SB) $(RM) $(REF_DELAY) $(RM) $(REF_CF) $(RM) $(TST_ASTRIP) $(REF_ASTRIP) $(RM) $(REF_CONCAT) $(TST_CONCAT)veryclean: clean cleantest $(RM) $(EXE)test: test-xed test-sb test-fdelay test-cf test-astrip test-concat# ----------------------------------------------------------------------# Specific targets# ----------------------------------------------------------------------add: add.oadd.o: sub-add.c $(CC) -c $(CC_OPT) -DADD_FILES -o add.o sub-add.casc2bin: asc2bin.c $(CC) $(CC_OPT) -o $@ $<astrip: astrip.c $(CC) $(CC_OPT) -o astrip astrip.c -lmbin2asc: bin2asc.c $(CC) $(CC_OPT) -o $@ $< -lmcf: compfile.c $(CC) $(CC_OPT) -o cf compfile.c -lmconcat: concat.c $(CC) $(CC_OPT) -o concat concat.cdf: dumpfile.c $(CC) $(CC_OPT) -o df dumpfile.c -lmendian: endian.c $(CC) -DRUN -o endian endian.cfdelay: fdelay.c $(CC) $(CC_OPT) -o fdelay fdelay.c -lmmeasure.o: measure.cmeasure: measure.o $(CC) -o measure measure.o -lmoper.o: oper.coper: oper.o $(CC) -o oper oper.o -lmsb: sb.osb.o: sb.csine.o: sine.csine: sine.o $(CC) -o sine sine.o -lmsub: sub.osub.o: sub-add.c $(CC) -c $(CC_OPT) -o sub.o sub-add.cchr2sh: chr2sh.ochr2sh.o: chr2sh.csh2chr: sh2chr.osh2chr.o: sh2chr.ccrc: getcrc32.c $(CC) $(C_OPT) -o crc getcrc32.cxencode: xencode.c $(CC) $(CC_OPT) $(WHO) -o xencode xencode.cxdecode: xdecode.c $(CC) $(CC_OPT) -o xdecode xdecode.c#===============================================================# Testing astrip#===============================================================test-astrip: cftest1.dat astrip.ref ./astrip cp cftest1.dat astrip.inp sb -over -if little astrip.inp astrip -q -smooth -wlen 145 -sample astrip.inp astrip.smp $(DIFF) astrip.smp astrip.ref astrip -q -smooth -wlen 145 astrip.inp astrip.blk 160 $(DIFF) astrip.blk astrip.refastrip.ref: tstunsup.zip $(UNZIP) tstunsup.zip $(REF_ASTRIP) touch astrip.ref sb -over -if little astrip.ref#===============================================================# Testing cf [compfile]#===============================================================cftest1.dat: tstunsup.zip $(UNZIP) tstunsup.zip $(REF_CF) touch cftest1.dattest-cf: cftest1.dat # Difference in Block 1, sample 69 cf -short cftest1.dat cftest2.dat # Difference in Block 1, sample 35 cf -long cftest1.dat cftest2.dat # Difference in Block 1, sample 35 cf -float cftest1.dat cftest2.dat # Difference in Block 1, sample 18 cf -double cftest1.dat cftest2.dat # Difference in Block 1, sample 69 cf -h cftest1.dat cftest2.dat # Difference in Block 1, sample 35 cf -h -long cftest1.dat cftest2.dat # Difference in Block 1, sample 69 cf -delay -2 cftest1.dat cftest3.dat # Difference in Block 1, sample 69 cf -delay 2 cftest3.dat cftest1.dat # No differences cf -delay -2 cftest2.dat cftest3.dat#===============================================================# Testing concat#===============================================================test-concat: $(REF_CONCAT) concat -undo undo.txt concat1.txt concat2.txt concat3.tst diff concat3.tst concat3.txtconcat1.txt: tstunsup.zip $(UNZIP) tstunsup.zip $(REF_CONCAT) touch concat1.txt#===============================================================# Testing sb#===============================================================bigend.src: $(UNZIP) tstunsup.zip bigend.src litend.src touch bigend.srctest-sb: cf sb bigend.src ./sb bigend.src bytswpd.tst cf -h litend.src bytswpd.tst ./sb -over bytswpd.tst cf -h bigend.src bytswpd.tst#===============================================================# Testing fdelay.c#===============================================================test-fdelay: bigend.src proc-fdelay comp-fdelayproc-fdelay: fdelay bigend.src delaydft.tst fdelay -file litend.src bigend.src delayfil.tst sb -over -if little bigend.src fdelay -law a bigend.src delay-a.tst fdelay -delay 57 -law u bigend.src delay-u.tst fdelay -dec 15 bigend.src delay-15.tst fdelay -hex 0xF bigend.src delay-0f.tst $(RM) bigend.srccomp-fdelay: delaydft.ref $(DIFF) delaydft.tst delaydft.ref $(DIFF) delayfil.tst delayfil.ref $(DIFF) delay-a.tst delay-a.ref $(DIFF) delay-u.tst delay-u.ref $(DIFF) delay-15.tst delay-15.ref $(DIFF) delay-0f.tst delay-15.refdelaydft.ref: $(UNZIP) tstunsup.zip delay*.ref touch delaydft.ref sb -over -if little delay-15.ref sb -over -if little delay-a.ref sb -over -if little delay-u.ref#===============================================================# Testing xencode/xdecode#===============================================================voice.uue: $(UNZIP) tstunsup.zip voice.uue voice01.uue printme.eps printme.uue touch voice.uuetest-xed: voice.uue #---------------------------------------------------------------------- # **** Testing for a BINARY file **** # **** No differences should be found here **** $(XD) voice.uue $(DIFF) voice.rec voice.ori # **** Now, differences may appear only in the preamble # (i.e., before the begin line) $(XE) voice.rec v.uue 7 -$(DIFF) v.uue voice.uue -$(DIFF) v01.uue voice01.uue # #---------------------------------------------------------------------- # **** Testing for an ASCII file **** # **** No differences should be found here **** $(XD) printme.uue $(DIFF) printme.ps printme.eps # **** Now, differences may appear only in the preamble # (i.e., before the begin line) $(XE) printme.ps print_me.uue -$(DIFF) print_me.uue printme.uue $(RM) voice.rec v.uue v01.uue printme.ps print_me.uue#===============================================================
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -