diff options
author | Joshua Bakita <jbakita@cs.unc.edu> | 2020-10-19 01:09:53 -0400 |
---|---|---|
committer | Joshua Bakita <jbakita@cs.unc.edu> | 2020-10-19 01:09:53 -0400 |
commit | a71fc97fd262e1b5770f827047ea60bbaf38d9a2 (patch) | |
tree | b45ef48c63a35817f2db93dd2fec718778f58b99 /dis/Makefile | |
parent | 41358857592f1908d0c0f9898b6c9acabc1ad161 (diff) |
Unify all the versions of extra.h into a single multipurpose header
There was previously a huge amount of shared code that had to be
copied back and forth. This should reduce the maintenance burden
by containing all future changes to a single file.
New unified library is fully backwards-compatible but also
introduces and the easy-to-use `for_each_job` macro which
replaces the specific `for(...) START_LOOP ... STOP_LOOP`
format requirement and is generally much harder to abuse.
New unified library also automatically cleans up its shared memory
and semaphores, so this commit also removes the separate
`cleanupSemaphores` binary.
I also found a precursor of `extra.h` written by Sims in
`litmusStuff.h`. This code is only interesting for historical
purposes, so it is also removed in this commit.
This commit also adds debug options to all the Makefiles and
silences rm's complaints about non-existent files in make clean.
Diffstat (limited to 'dis/Makefile')
-rwxr-xr-x | dis/Makefile | 33 |
1 files changed, 16 insertions, 17 deletions
diff --git a/dis/Makefile b/dis/Makefile index 2c1ff89..df93116 100755 --- a/dis/Makefile +++ b/dis/Makefile | |||
@@ -4,34 +4,33 @@ | |||
4 | # that a good Makefile should follow. Sorry - at least I have one.) | 4 | # that a good Makefile should follow. Sorry - at least I have one.) |
5 | LIBLITMUS ?= /media/speedy/litmus/liblitmus | 5 | LIBLITMUS ?= /media/speedy/litmus/liblitmus |
6 | CC ?= gcc | 6 | CC ?= gcc |
7 | override CFLAGS += -pthread -O2 | 7 | CFLAGS += -pthread -O2 -I.. |
8 | LDFLAGS = -lrt -lm | 8 | LDFLAGS = -lrt -lm |
9 | 9 | COMMON = ../extra.h | |
10 | # We need a different include path depending on the target, so use a | ||
11 | # target-specific variable | ||
12 | field matrix neighborhood pointer transitive update random_walk: override CFLAGS += -I../baseline/source | ||
13 | field matrix neighborhood pointer transitive update random_walk: COMMON = ../baseline/source/extra.h | ||
14 | field_all matrix_all neighborhood_all pointer_all transitive_all update_all: override CFLAGS += -I../all_pairs/source | ||
15 | field_all matrix_all neighborhood_all pointer_all transitive_all update_all: COMMON = ../all_pairs/source/extra.h | ||
16 | 10 | ||
17 | # Handle cases where we're also profiling with the MMDC on the i.MX6Q | 11 | # Handle cases where we're also profiling with the MMDC on the i.MX6Q |
18 | ifneq ($(shell grep "define MMDC 1" ../baseline/source/extra.h),) | 12 | ifneq ($(shell grep "define MMDC 1" ../extra.h),) |
19 | COMMON += /media/speedy/litmus/tools/mmdc/mmdc.c | 13 | COMMON += /media/speedy/litmus/tools/mmdc/mmdc.c |
20 | endif | 14 | endif |
21 | 15 | ||
22 | # Include all the LITMUS^RT headers if we're using it | 16 | # Include all the LITMUS^RT headers if we're using it |
23 | ifneq ($(shell grep "define LITMUS 1" ../baseline/source/extra.h),) | 17 | ifneq ($(shell grep "define LITMUS 1" ../extra.h),) |
24 | CFLAGS += -I${LIBLITMUS}/include -I${LIBLITMUS}/arch/arm/include | 18 | CFLAGS += -I${LIBLITMUS}/include -I${LIBLITMUS}/arch/arm/include |
25 | LDFLAGS += -L${LIBLITMUS} -llitmus | 19 | LDFLAGS += -L${LIBLITMUS} -llitmus |
26 | endif | 20 | endif |
27 | 21 | ||
28 | all: baseline | 22 | all: baseline |
23 | debug: baseline | ||
24 | debug_pairs: pairs | ||
25 | debug debug_pairs: CFLAGS += -ggdb3 | ||
29 | baseline: field matrix neighborhood pointer transitive update random_walk | 26 | baseline: field matrix neighborhood pointer transitive update random_walk |
30 | pairs: field_all matrix_all neighborhood_all pointer_all transitive_all update_all | 27 | pairs: field_all matrix_all neighborhood_all pointer_all transitive_all update_all |
31 | 28 | ||
32 | .PHONY: clean | 29 | .PHONY: clean |
33 | clean: | 30 | clean: |
34 | rm field_all matrix_all neighborhood_all pointer_all transitive_all update_all field matrix neighborhood pointer transitive update random_walk | 31 | rm -f field_all matrix_all neighborhood_all pointer_all \ |
32 | transitive_all update_all field matrix neighborhood \ | ||
33 | pointer transitive update random_walk | ||
35 | 34 | ||
36 | field: ${COMMON} ./Field/field.c | 35 | field: ${COMMON} ./Field/field.c |
37 | $(CC) $(CFLAGS) $^ -o $@ $(LDFLAGS) | 36 | $(CC) $(CFLAGS) $^ -o $@ $(LDFLAGS) |
@@ -49,14 +48,14 @@ random_walk: ${COMMON} random_walk.c | |||
49 | $(CC) $(CFLAGS) $^ -o $@ $(LDFLAGS) | 48 | $(CC) $(CFLAGS) $^ -o $@ $(LDFLAGS) |
50 | 49 | ||
51 | field_all: ${COMMON} ./Field/field.c | 50 | field_all: ${COMMON} ./Field/field.c |
52 | $(CC) $(CFLAGS) $^ -o $@ $(LDFLAGS) | 51 | $(CC) $(CFLAGS) -DPAIRED $^ -o $@ $(LDFLAGS) |
53 | matrix_all: ${COMMON} ./Matrix/ver2/matrix.c | 52 | matrix_all: ${COMMON} ./Matrix/ver2/matrix.c |
54 | $(CC) $(CFLAGS) $^ -o $@ $(LDFLAGS) | 53 | $(CC) $(CFLAGS) -DPAIRED $^ -o $@ $(LDFLAGS) |
55 | neighborhood_all: ${COMMON} ./Neighborhood/neighborhood.c | 54 | neighborhood_all: ${COMMON} ./Neighborhood/neighborhood.c |
56 | $(CC) $(CFLAGS) $^ -o $@ $(LDFLAGS) | 55 | $(CC) $(CFLAGS) -DPAIRED $^ -o $@ $(LDFLAGS) |
57 | pointer_all: ${COMMON} ./Pointer/pointer.c | 56 | pointer_all: ${COMMON} ./Pointer/pointer.c |
58 | $(CC) $(CFLAGS) $^ -o $@ $(LDFLAGS) | 57 | $(CC) $(CFLAGS) -DPAIRED $^ -o $@ $(LDFLAGS) |
59 | transitive_all: ${COMMON} ./Transitive/transitive.c | 58 | transitive_all: ${COMMON} ./Transitive/transitive.c |
60 | $(CC) $(CFLAGS) $^ -o $@ $(LDFLAGS) | 59 | $(CC) $(CFLAGS) -DPAIRED $^ -o $@ $(LDFLAGS) |
61 | update_all: ${COMMON} ./Update/update.c | 60 | update_all: ${COMMON} ./Update/update.c |
62 | $(CC) $(CFLAGS) $^ -o $@ $(LDFLAGS) | 61 | $(CC) $(CFLAGS) -DPAIRED $^ -o $@ $(LDFLAGS) |