-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
28 lines (21 loc) · 899 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
.PHONY: all clean
EXAMPLES := $(addprefix examples_build/,$(notdir $(basename $(wildcard examples/*.c))))
FILES_ALLOWED_FOR_CHANGE := $(shell cat files_allowed_for_change)
CHANGED_FILES := $(wildcard $(FILES_ALLOWED_FOR_CHANGE))
TEMPLATE_HASH := $(shell cat template_hash)
CFLAGS := --std=gnu11 -Wall -DDEBUG -pthread
TESTS := $(wildcard tests/*.self)
CHANNEL_SRC := channel.c channel.h
MIMPI_COMMON_SRC := $(CHANNEL_SRC) mimpi_common.c mimpi_common.h
MIMPIRUN_SRC := $(MIMPI_COMMON_SRC) mimpirun.c
MIMPI_SRC := $(MIMPI_COMMON_SRC) mimpi.c mimpi.h
all: mimpirun $(EXAMPLES) $(TESTS)
mimpirun: $(MIMPIRUN_SRC)
gcc $(CFLAGS) -o $@ $(filter %.c,$^)
examples_build/%: examples/%.c $(MIMPI_SRC)
mkdir -p examples_build
gcc $(CFLAGS) -o $@ $(filter %.c,$^)
assignment.zip: $(CHANGED_FILES)
zip assignment.zip $(CHANGED_FILES) template_hash
clean:
rm -rf mimpirun assignment.zip examples_build