Notice, I'm new to "makefile"
I have program called "ba.lex" I need to create make file for it.
without the makefile, I first call:
flex ba.lex
then, I create executable:
gcc -o ba lex.yy.c -lfl
I will also need to clean the intermediate file: lex.yy.c
How I could put these on a makefile.
Update: I tried this:
flex ba.lex
gcc -o ba lex.yy.c -lfl
but I'm getting: makefile:1: *** commands commence before first target. Stop.
答案 0 :(得分:3)
In a var
Codec: TCodec;
CipherText: AnsiString;
begin
Codec := TCodec.Create(nil);
try
Codec.CryptoLibrary := TCryptographicLibrary.Create(Codec);
//
Codec.StreamCipherId = 'native.StreamToBlock';
Codec.BlockCipherId = 'native.AES-256';
Codec.ChainModeId = 'native.CTR';
//
Codec.Password := 'my password';
Codec.DecryptAnsiString(CipherText, 'oyC1KRVx3JZBLlI=');
//
Result := string(CipherText);
finally
Codec.Free;
end;
end;
you don't just write commands, that's what shell scripts are for. A Makefile
has 3 main entities:
A very simple Makefile
example can be this one:
Makefile
Here, build: a.out
a.out: a.c
<TAB> gcc -Wall a.c
is a target that depends on build
(which is a file, but we've also created a target with that name). The target a.out
depends on a.out
file. What happens when you run a.c
is:
make
In your case, a possible if (! file_exists(a.out) || last_change(a.out) < last_change(a.c)) then
execute gcc command
can be:
Makefile