-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
57 lines (40 loc) · 1.09 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
# ===============================================================
# Makefile
#
# To built 'name' with or without debugging ...
# > gmake 'name' or > gmake 'name' DEB=-g
#
# ================================================================
# Run make DEB=-g to build in debug mode
DEB =
# the executable will be in $(HOME)/$(OS)
OS = .
# the main directory
MAIN = .
# specific code
# The name of the executable
NAME = xrdping
# *.F files are stored in SRCDIR
SRCDIR = $(MAIN)
# Special libs
ULIB = -lresolv -lm -ldl
# set C flags
CC = g++
CCFLAGS = $(DEB) -c -pipe -Wall -W -Woverloaded-virtual -fPIC
# vpath %.cc $(SRCDIR)
# *.o files are stored in $(OBJDIR)
OBJDIR = .
vpath %.o $(OBJDIR)
O_FILES := $(CCFILES:%.cc=%.o)
OBJFILES := $(addprefix $(OBJDIR)/,$(notdir $(O_FILES)))
# Rules...
all: $(NAME)
@ echo "Making all ..."
xrdping: $(MAIN)/xrdping.o
@ echo "Linking ... $@"
$(CC) $(DEB) -o $@ $(MAIN)/xrdping.o $(ULIB)
$(OBJDIR)/%.o: %.cc
@echo "CCFLAGS ... $(CCFLAGS)"
$(CC) $(DEB) $(CCFLAGS) $< -o $@
clean:
rm -f $(MAIN)/*.o $(OBJDIR)/xrdping