aboutsummaryrefslogtreecommitdiff
path: root/gprofng/examples/mxv-pthreads/src/Makefile
blob: 24b9c8e9d360e1024faa2d19d2019f50ddeb4334 (plain)
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#
#   Copyright (C) 2021-2025 Free Software Foundation, Inc.
#
# This file is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; see the file COPYING3.  If not see
# <http://www.gnu.org/licenses/>.

CC       = gcc
WARNINGS = -Wall -Werror=undef -Wstrict-prototypes
OPT      = -g -O
CFLAGS   = $(OPT) $(WARNINGS)
LDFLAGS  =
LIBS     = -lm -lpthread
OBJDIR   = ../objects
BINDIR   = ../bindir
EXPDIR   = ../experiments

EXE     = mxv-pthreads
OBJECTS = $(OBJDIR)/main.o $(OBJDIR)/manage_data.o $(OBJDIR)/workload.o $(OBJDIR)/mxv.o

default: $(BINDIR)/$(EXE)

$(BINDIR)/$(EXE): $(OBJECTS)
	@mkdir -p $(BINDIR)
	$(CC) -o $(BINDIR)/$(EXE) $(LDFLAGS) $(OBJECTS) $(LIBS)
	ldd $(BINDIR)/$(EXE)

$(OBJDIR)/main.o: main.c
	@mkdir -p $(OBJDIR)
	$(CC) -o $(OBJDIR)/main.o -c $(CFLAGS) main.c
$(OBJDIR)/manage_data.o: manage_data.c
	@mkdir -p $(OBJDIR)
	$(CC) -o $(OBJDIR)/manage_data.o -c $(CFLAGS) manage_data.c
$(OBJDIR)/workload.o: workload.c
	@mkdir -p $(OBJDIR)
	$(CC) -o $(OBJDIR)/workload.o -c $(CFLAGS) workload.c
$(OBJDIR)/mxv.o: mxv.c
	@mkdir -p $(OBJDIR)
	$(CC) -o $(OBJDIR)/mxv.o -c $(CFLAGS) mxv.c

$(OBJECTS): mydefs.h

.c.o:
	$(CC) -c -o $@ $(CFLAGS) $<

check:
	@echo "Running $(EXE) in $(EXPDIR)"
	@./$(EXPDIR)/$(EXE) -m 1000 -n 1500 -t 2

install: $(BINDIR)/$(EXE)
	@/bin/cp $(BINDIR)/$(EXE) $(EXPDIR)
	@echo "Installed $(EXE) in $(EXPDIR)"

clean:
	@/bin/rm -f $(BINDIR)/$(EXE)
	@/bin/rm -f $(OBJECTS)

veryclean:
	@make clean
	@/bin/rm -f $(EXPDIR)/$(EXE)