mirror of
https://github.com/Steffo99/unimore-hpc-assignments.git
synced 2024-11-30 03:54:20 +00:00
42 lines
No EOL
624 B
Makefile
42 lines
No EOL
624 B
Makefile
INCPATHS = -I$(UTIL_DIR)
|
|
|
|
BENCHMARK = $(shell basename `pwd`)
|
|
EXE = $(BENCHMARK)_acc
|
|
SRC = $(BENCHMARK).c
|
|
HEADERS = $(BENCHMARK).h
|
|
|
|
SRC += $(UTIL_DIR)/polybench.c
|
|
|
|
DEPS := Makefile.dep
|
|
DEP_FLAG := -MM
|
|
|
|
CC=gcc
|
|
LD=ld
|
|
OBJDUMP=objdump
|
|
|
|
OPT=-O2 -g -fopenmp
|
|
CFLAGS=$(OPT) -I. $(EXT_CFLAGS)
|
|
LDFLAGS=-lm $(EXT_LDFLAGS)
|
|
|
|
.PHONY: all exe clean veryclean
|
|
|
|
all : exe
|
|
|
|
exe : $(EXE)
|
|
|
|
$(EXE) : $(SRC)
|
|
$(CC) $(CFLAGS) $(INCPATHS) $^ -o $@ $(LDFLAGS)
|
|
|
|
clean :
|
|
-rm -f $(EXE) *~
|
|
|
|
veryclean : clean
|
|
-rm -f $(DEPS)
|
|
|
|
run: $(EXE)
|
|
./$(EXE)
|
|
|
|
$(DEPS): $(SRC) $(HEADERS)
|
|
$(CC) $(INCPATHS) $(DEP_FLAG) $(SRC) > $(DEPS)
|
|
|
|
-include $(DEPS) |