-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
63 lines (47 loc) · 1.16 KB
/
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
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
# Author: Debajyoti Nandi <[email protected]>
# Created: 2016-07-09
# Modified: 2016-11-30
# License: MIT License (See LICENSE.txt)
#
# Note: Update the "headers", "object files" and the "executable"
# sections as needed.
#
# See:
# http://www.cs.colby.edu/maxwell/courses/tutorials/maketutor/
# Compiler:
CLANG = clang-3.6
GCC = gcc
CC = $(GCC)
#CC = $(CLANG)
# Compiler flags:
CFLAGS = -std=gnu11 -Ofast #-DDEBUG
# Include directory:
IDIR = .
# Library directory:
LDIR = .
# Object directory:
ODIR = .
# Libraries
LIBS = -lpthread
# Headers
_DEPS = util.h qseries.h partition.h
DEPS = $(patsubst %,$(IDIR)/%,$(_DEPS))
# Object files:
_OBJS = util.o qseries.o partition.o
OBJS = $(patsubst %,$(ODIR)/%$(_OBJS))
# Executables:
EXES = genpartn partnid
$(ODIR)/%.o: %.c $(DEPS)
$(CC) $(CFLAGS) -c $< -o $@
all: $(EXES)
genpartn: genpartn.c partition.o
$(CC) $(CFLAGS) -o $@ $^ $(LIBS)
@echo "---> Successfully compiled executable: genpartn*"
partnid: partnid.c partition.o qseries.o util.o
$(CC) $(CFLAGS) -o $@ $^ $(LIBS)
@echo "---> Successfully compiled executable: partnid*"
.PHONY: clean
clean:
$(RM) $(ODIR)/*.o
distclean: clean
$(RM) $(EXES)