Skip to content
Snippets Groups Projects
Commit 21859c08 authored by Henrik (Grubba) Grubbström's avatar Henrik (Grubba) Grubbström
Browse files

Improved support for cross-compilation.

Rev: src/modules/Gmp/Makefile.in:1.12
Rev: src/modules/Gmp/prime_table.pike:1.1
parent e5bd47e3
No related branches found
No related tags found
No related merge requests found
...@@ -220,6 +220,7 @@ testfont binary ...@@ -220,6 +220,7 @@ testfont binary
/src/modules/Gmp/my_mpz_xor.c foreign_ident /src/modules/Gmp/my_mpz_xor.c foreign_ident
/src/modules/Gmp/next_prime.c foreign_ident /src/modules/Gmp/next_prime.c foreign_ident
/src/modules/Gmp/prime_table.c foreign_ident /src/modules/Gmp/prime_table.c foreign_ident
/src/modules/Gmp/prime_table.pike foreign_ident
/src/modules/Gmp/testsuite.in foreign_ident /src/modules/Gmp/testsuite.in foreign_ident
/src/modules/Gz/Makefile.in foreign_ident /src/modules/Gz/Makefile.in foreign_ident
/src/modules/Gz/acconfig.h foreign_ident /src/modules/Gz/acconfig.h foreign_ident
......
# $Id: Makefile.in,v 1.11 1999/11/18 07:58:54 hubbe Exp $ # $Id: Makefile.in,v 1.12 2000/08/01 21:53:22 grubba Exp $
@make_variables@ @make_variables@
VPATH=@srcdir@:@srcdir@/../..:../.. VPATH=@srcdir@:@srcdir@/../..:../..
MODULE_LDFLAGS=@LDFLAGS@ @LIBS@ MODULE_LDFLAGS=@LDFLAGS@ @LIBS@
...@@ -12,12 +12,15 @@ CONFIG_HEADERS=@CONFIG_HEADERS@ ...@@ -12,12 +12,15 @@ CONFIG_HEADERS=@CONFIG_HEADERS@
next_prime.o: prime_table.out next_prime.o: prime_table.out
prime_table.out: prime_table prime_table.out: prime_table@CROSS@
./prime_table $(PRIME_LIMIT) >prime_table.out ./prime_table@CROSS@ $(PRIME_LIMIT) >prime_table.out
prime_table: $(SRCDIR)/prime_table.c prime_table: $(SRCDIR)/prime_table.c
$(CC) $(CFLAGS) $(SRCDIR)/prime_table.c -o prime_table $(CC) $(CFLAGS) $(SRCDIR)/prime_table.c -o prime_table
prime_table.pike: $(SRCDIR)/prime_table.pike
test -f prime_table.pike || ln -s $(SRCDIR)/prime_table.pike
depend: prime_table.out depend: prime_table.out
@dependencies@ @dependencies@
#!/usr/local/bin/pike
#pragma strict_types
/* $Id: prime_table.pike,v 1.1 2000/08/01 21:53:22 grubba Exp $
*
* Generates a table of primes.
* Used when cross-compiling.
*
* Henrik Grubbstrm 2000-08-01
*/
int main(int argc, array(string) argv)
{
if (argc != 2) {
werror("Bad number of arguments!\n");
exit(1);
}
int count = (int)argv[1];
write(sprintf("/* Automatically generated by\n"
" * $Id: prime_table.pike,v 1.1 2000/08/01 21:53:22 grubba Exp $\n"
" *%{ %s%}\n"
" * Do not edit.\n"
" */\n"
"\n"
"#define NUMBER_OF_PRIMES %d\n"
"\n"
"const unsigned long primes[NUMBER_OF_PRIMES] = {",
argv, count));
int prime = 1;
for (int i=0; i < count; i++) {
prime = (prime+1)->next_prime();
if (!(i%10)) {
write(sprintf("\n %d,", prime));
} else {
write(sprintf(" %d,", prime));
}
}
write("\n};\n"
"\n");
return 0;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment