Skip to content

Commit

Permalink
generalise dSFMT521 rule to make dSFMTanything; make 4 examples by de…
Browse files Browse the repository at this point in the history
…fault
  • Loading branch information
Douglas Bagnall committed May 8, 2011
1 parent b1a2920 commit 5164cf2
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 7 deletions.
17 changes: 12 additions & 5 deletions Makefile
Expand Up @@ -95,13 +95,19 @@ dSFMT/dSFMT.o: dSFMT/dSFMT.c
dSFMT.so: dSFMT/dSFMT.o dSFMT.o
$(CC) -fPIC -pthread -shared -Wl,-O1 -o $@ $+

dSFMT521.o: dSFMT.c
$(CC) -Iinclude -c -MD $(ALL_CFLAGS) $(CPPFLAGS) -DDSFMT_MEXP=521 -o $@ $<
#DSFMT_SIZES excludes default of 19937
DSFMT_SIZES = 521 1279 2203 4253 11213 44497 86243 132049 216091
DSFMT_O = $(patsubst %,dSFMT%.o,$(DSFMT_SIZES))
DSFMT_SO = $(patsubst %,dSFMT%.so,$(DSFMT_SIZES))
DSFMT_DSFMT_O = $(patsubst %,dSFMT/dSFMT%.o,$(DSFMT_SIZES))

dSFMT/dSFMT521.o: dSFMT/dSFMT.c
$(CC) $(DSFMT_FLAGS) -MD $(ALL_CFLAGS) -DDSFMT_MEXP=521 -fvisibility=hidden $(CPPFLAGS) -c -o $@ $<
$(DSFMT_O): dSFMT.c
$(CC) -Iinclude -c -MD $(ALL_CFLAGS) $(CPPFLAGS) -DDSFMT_MEXP=$(patsubst dSFMT%.o,%,$@) -o $@ $<

dSFMT521.so: dSFMT/dSFMT521.o dSFMT521.o
$(DSFMT_DSFMT_O): dSFMT/dSFMT.c
$(CC) $(DSFMT_FLAGS) -MD $(ALL_CFLAGS) -DDSFMT_MEXP=$(patsubst dSFMT/dSFMT%.o,%,$@) -fvisibility=hidden $(CPPFLAGS) -c -o $@ $<

$(DSFMT_SO): dSFMT%.so: dSFMT/dSFMT%.o dSFMT%.o
$(CC) -fPIC -pthread -shared -Wl,-O1 -o $@ $+

phelix/phelix.o: phelix/phelix.c
Expand Down Expand Up @@ -136,6 +142,7 @@ hc128.so: hc128.o sha1.o

SPECIAL_MODULES = dSFMT.so sosemanuk.so isaac64.so isaac.so hc128.so salsa20_8.so salsa20_12.so
SPECIAL_MODULES += mt19937module.so lcg.so dummyc.so phelix.so testbits.so
SPECIAL_MODULES += dSFMT521.so dSFMT1279.so dSFMT2203.so dSFMT216091.so
free:: $(SPECIAL_MODULES)
all:: free
emitters:: bin/sosemanuk-emitter
Expand Down
9 changes: 7 additions & 2 deletions test.py
Expand Up @@ -36,8 +36,10 @@

FAST = [
'dSFMT521',
'dSFMT1279',
'dSFMT2203',
'dSFMT216091',
'chacha8',
'abc3',
'hc_128',
'rabbit',
'sosemanuk2',
Expand Down Expand Up @@ -71,8 +73,11 @@

TEST = ['testbits',]

BAD = ['abc3', ]


DEFAULT = FAST
MOST = DEFAULT + SLOW
MOST = DEFAULT + SLOW + BAD
ALL = DEFAULT + SLOW + REALLY_SLOW + TEST

#test fuctions borrowed from standard random module
Expand Down

0 comments on commit 5164cf2

Please sign in to comment.