automake
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Adding extra rules to make


From: Daniel Leidert
Subject: Re: Adding extra rules to make
Date: Thu, 21 Jun 2007 18:36:50 +0200

Am Donnerstag, den 21.06.2007, 13:56 +0200 schrieb address@hidden:
> Hello,
> 
> As part of the build process, I would like to convert text files to
> binary files. They don't get installed, the files can be used later to
> test the program.
> 
> In particular, the input format is *.txt and the output format is *.bin.
> 
> I've got it working, but I feel it's far from elegant. I want it to be
> part of the distribution package, the .bin files to be generated by
> the source .txt files but I don't want them to be installed anywhere.
> 
> Thanks,
> Jason.
> 
> Makefile.am
> SRC = 01_InvalidByte.txt      \
>       02_CorruptedMsg.txt     \
>       03_InvalidByte.txt      \
>       04_InvalidByteAscii.txt \
>       05_BufferOverrun.txt
> 
> # The rule:
> #   BIN = $(SRC:.txt=.bin)
> # doesn't seem to work

Works here (but see SUFFIXES).

> BIN = 01_InvalidByte.bin      \
>       02_CorruptedMsg.bin     \
>       03_InvalidByte.bin      \
>       04_InvalidByteAscii.bin \
>       05_BufferOverrun.bin
> 
> CLEANFILES = $(BIN)
> 
> EXTRA_DIST = $(SRC) pxxd.pl
> 
> all: $(BIN)

This should be `all-local:'. The all-target is automatically created by
automake.

> # When we 'make' we create generate the bin files
> .txt.bin: 
>       perl pxxd.pl $< $@

I guess, you further need a

SUFFIXES = .txt .bin

Then it works here.

Regards, Daniel





reply via email to

[Prev in Thread] Current Thread [Next in Thread]