-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
50 lines (38 loc) · 1.06 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
# this is the makefile for the thimble_monte_carlo code.
# system specific definitions:
SRCDIR=.
OBJDIR=.
BINDIR=.
MPIDIR=
CC=mpicc -g
AR=ar
# code specific definitions:
TGLIB = libggfft.a
TGPROG = test_fft
CFLAGS=-I. -g -msse3 -Wall
LDFLAGS=-L. -lggfft -lm -Wall
# general definitions and rules: FIX THE LACK O FDEPENDENCY ON HEADERS!!!!
#DEPFLAGS = -MM
SOURCES := $(wildcard $(SRCDIR)/*.c)
INCLUDES := $(wildcard $(SRCDIR)/*.h)
OBJECTS := $(SOURCES:$(SRCDIR)/%.c=$(OBJDIR)/%.o)
#DEPS := $(SOURCES:$(SRCDIR)/%.c=$(OBJDIR)/%.d)
rm = rm -f
all: $(TGLIB) $(TGPROG)
$(BINDIR)/$(TGLIB) : $(OBJECTS)
@$(AR) cr $(BINDIR)/$(TGLIB) $(OBJECTS)
@echo "Library complete!"
$(BINDIR)/$(TGPROG) : $(OBJECTS)
@$(CC) $(CFLAGS) $(OBJECTS) -o $@ $(LDFLAGS)
@echo "Linking complete!"
$(OBJECTS): $(OBJDIR)/%.o : $(SRCDIR)/%.c
@$(CC) $(CFLAGS) -c $< -o $@
@echo "Compiled "$<" successfully!"
.PHONEY: clean
clean:
@$(rm) $(OBJECTS)
@echo "Cleanup complete!"
.PHONEY: remove
remove:
@$(rm) $(OBJECTS) $(BINDIR)/$(TGPROG) $(BINDIR)/$(TGLIB)
@echo "Objects and Executable removed!"