summaryrefslogtreecommitdiffstats
path: root/dis/Makefile
diff options
context:
space:
mode:
authorJoshua Bakita <jbakita@cs.unc.edu>2020-10-19 01:09:53 -0400
committerJoshua Bakita <jbakita@cs.unc.edu>2020-10-19 01:09:53 -0400
commita71fc97fd262e1b5770f827047ea60bbaf38d9a2 (patch)
treeb45ef48c63a35817f2db93dd2fec718778f58b99 /dis/Makefile
parent41358857592f1908d0c0f9898b6c9acabc1ad161 (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-xdis/Makefile33
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.)
5LIBLITMUS ?= /media/speedy/litmus/liblitmus 5LIBLITMUS ?= /media/speedy/litmus/liblitmus
6CC ?= gcc 6CC ?= gcc
7override CFLAGS += -pthread -O2 7CFLAGS += -pthread -O2 -I..
8LDFLAGS = -lrt -lm 8LDFLAGS = -lrt -lm
9 9COMMON = ../extra.h
10# We need a different include path depending on the target, so use a
11# target-specific variable
12field matrix neighborhood pointer transitive update random_walk: override CFLAGS += -I../baseline/source
13field matrix neighborhood pointer transitive update random_walk: COMMON = ../baseline/source/extra.h
14field_all matrix_all neighborhood_all pointer_all transitive_all update_all: override CFLAGS += -I../all_pairs/source
15field_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
18ifneq ($(shell grep "define MMDC 1" ../baseline/source/extra.h),) 12ifneq ($(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
20endif 14endif
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
23ifneq ($(shell grep "define LITMUS 1" ../baseline/source/extra.h),) 17ifneq ($(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
26endif 20endif
27 21
28all: baseline 22all: baseline
23debug: baseline
24debug_pairs: pairs
25debug debug_pairs: CFLAGS += -ggdb3
29baseline: field matrix neighborhood pointer transitive update random_walk 26baseline: field matrix neighborhood pointer transitive update random_walk
30pairs: field_all matrix_all neighborhood_all pointer_all transitive_all update_all 27pairs: field_all matrix_all neighborhood_all pointer_all transitive_all update_all
31 28
32.PHONY: clean 29.PHONY: clean
33clean: 30clean:
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
36field: ${COMMON} ./Field/field.c 35field: ${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
51field_all: ${COMMON} ./Field/field.c 50field_all: ${COMMON} ./Field/field.c
52 $(CC) $(CFLAGS) $^ -o $@ $(LDFLAGS) 51 $(CC) $(CFLAGS) -DPAIRED $^ -o $@ $(LDFLAGS)
53matrix_all: ${COMMON} ./Matrix/ver2/matrix.c 52matrix_all: ${COMMON} ./Matrix/ver2/matrix.c
54 $(CC) $(CFLAGS) $^ -o $@ $(LDFLAGS) 53 $(CC) $(CFLAGS) -DPAIRED $^ -o $@ $(LDFLAGS)
55neighborhood_all: ${COMMON} ./Neighborhood/neighborhood.c 54neighborhood_all: ${COMMON} ./Neighborhood/neighborhood.c
56 $(CC) $(CFLAGS) $^ -o $@ $(LDFLAGS) 55 $(CC) $(CFLAGS) -DPAIRED $^ -o $@ $(LDFLAGS)
57pointer_all: ${COMMON} ./Pointer/pointer.c 56pointer_all: ${COMMON} ./Pointer/pointer.c
58 $(CC) $(CFLAGS) $^ -o $@ $(LDFLAGS) 57 $(CC) $(CFLAGS) -DPAIRED $^ -o $@ $(LDFLAGS)
59transitive_all: ${COMMON} ./Transitive/transitive.c 58transitive_all: ${COMMON} ./Transitive/transitive.c
60 $(CC) $(CFLAGS) $^ -o $@ $(LDFLAGS) 59 $(CC) $(CFLAGS) -DPAIRED $^ -o $@ $(LDFLAGS)
61update_all: ${COMMON} ./Update/update.c 60update_all: ${COMMON} ./Update/update.c
62 $(CC) $(CFLAGS) $^ -o $@ $(LDFLAGS) 61 $(CC) $(CFLAGS) -DPAIRED $^ -o $@ $(LDFLAGS)