mirror of
https://github.com/Steffo99/unimore-hpc-assignments.git
synced 2024-11-29 03:24:22 +00:00
28 lines
391 B
Makefile
28 lines
391 B
Makefile
ifndef EXERCISE
|
|
EXERCISE=exercise1.c
|
|
endif
|
|
|
|
CC=gcc
|
|
LD=ld
|
|
OBJDUMP=objdump
|
|
|
|
OPT=-O2 -g -fopenmp
|
|
CFLAGS=$(OPT) -I. $(EXT_CFLAGS)
|
|
LDFLAGS=-lm $(EXT_LDFLAGS)
|
|
|
|
SRCS=main.c utils.c
|
|
OBJS=$(SRCS:.c=.o) $(EXERCISE:.c=.o)
|
|
EXE=$(EXERCISE:.c=.exe)
|
|
|
|
$(EXE): $(OBJS)
|
|
$(CC) $(CFLAGS) $(OBJS) -o $@ $(LDFLAGS)
|
|
|
|
all: $(EXE)
|
|
|
|
.PHONY: run clean
|
|
run: $(EXE)
|
|
./$(EXE)
|
|
|
|
clean:
|
|
rm -f $(OBJS) *.o *.exe *.out *~
|
|
|