Unify process_alloc() and process_realloc() with PROCESS_ALLOC_MODE_REALLOC bit
[moveable_pool.git] / gen.sh
1 #!/bin/sh -e
2
3 # call with -DNDEBUG to generate a release build of the expanded source
4 # (note that we cannot preserve #ifndef NDEBUG type constructs in output)
5
6 # call with -D__FUZIX__ -DNDEBUG to generate a fuzix build (smaller block
7 # sizes, and simplified hash function that doesn't use "long long" type)
8
9 sed -e 's/^#define MOVEABLE_POOL 1/\/\/#define MOVEABLE_POOL 1/' -i pool.c
10
11 sed -e 's/^\/\/#define INDIRECT_CORE 1/#define INDIRECT_CORE 1/' -i core.h
12 sed -e 's/^#define INDIRECT_SWAP 1/\/\/#define INDIRECT_SWAP 1/' -i swap.h
13 ./cpp.sh indirect_core_contiguous_swap "$@"
14 cp rassert.h indirect_core_contiguous_swap
15
16 sed -e 's/^\/\/#define INDIRECT_SWAP 1/#define INDIRECT_SWAP 1/' -i swap.h
17 ./cpp.sh indirect_core_indirect_swap "$@"
18 cp rassert.h indirect_core_indirect_swap
19
20 sed -e 's/^\/\/#define MOVEABLE_POOL 1/#define MOVEABLE_POOL 1/' -i pool.c
21
22 sed -e 's/^#define INDIRECT_CORE 1/\/\/#define INDIRECT_CORE 1/' -i core.h
23 sed -e 's/^#define INDIRECT_SWAP 1/\/\/#define INDIRECT_SWAP 1/' -i swap.h
24 ./cpp.sh moveable_core_contiguous_swap "$@"
25 rm moveable_core_contiguous_swap/block_pool.[ch]
26 cp rassert.h moveable_core_contiguous_swap
27
28 sed -e 's/^\/\/#define INDIRECT_SWAP 1/#define INDIRECT_SWAP 1/' -i swap.h
29 ./cpp.sh moveable_core_indirect_swap "$@"
30 cp rassert.h moveable_core_indirect_swap