-
Notifications
You must be signed in to change notification settings - Fork 11
/
Makefile
37 lines (26 loc) · 905 Bytes
/
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
TARGET = zdclient
BIN_DIR = /usr/bin/
INCLUDES =
LIBS = -lpcap
C_SOURCES = $(wildcard *.c)
C_OBJS = $(patsubst %.c, %.o, $(C_SOURCES))
# ------------ generate the names of the object files ------------------------
OBJECTS = $(addsuffix .o,$(BASENAMES))
# ------------ generate the names of the hidden prerequisite files -----------
PREREQUISITES = $(addprefix .,$(addsuffix .d,$(BASENAMES)))
# ------------ make the executable (the default goal) ------------------------
%.o:%.c
$(CC) -c $<$ $(CCFLAGS)
$(TARGET): $(CPP_OBJS) $(C_OBJS)
$(CXX)$(LINKFLAGS) -o $(TARGET) $^ $(LIBS)
all:$(TARGET)
clean:
rm -f $(CPP_OBJS) $(C_OBJS)
rm -f $(TARGET)
install: $(TARGET)
cp $(TARGET) $(BIN_DIR)
uninstall:
rm -f $(BIN_DIR)/$(TARGET)
rebuild: clean all
# ==============================================================================
# vim: set tabstop=2: set shiftwidth=2: