-
Notifications
You must be signed in to change notification settings - Fork 109
/
makefile
67 lines (55 loc) · 1.76 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
64
65
66
#
# FreeModbus Linux PORT - Makefile
#
# Copyright (c) 2006 Christian Walter, ? s::can, Vienna 2006.
#
# ---------------------------------------------------------------------------
# ---------------------------------------------------------------------------
# platform dependencies
# ---------------------------------------------------------------------------
ifneq ($(strip $(shell gcc -v 2>&1 |grep "cygwin")),)
CYGWIN_BUILD = YES
endif
CC = gcc
CXX = g++
OBJCOPY = objcopy
INSIGHT = /opt/insight-x86/bin/insight
# ---------------------------------------------------------------------------
# project specifics
# ---------------------------------------------------------------------------
CFLAGS = -MD -g3 -Wall
LDFLAGS =
ifeq ($(CYGWIN_BUILD),YES)
else
#LDFLAGS += -lpthread
endif
TGT = 1
OTHER_CSRC =
OTHER_ASRC =
CSRC = dlt645_api_07.c main.c
ASRC =
OBJS = $(CSRC:.c=.o) $(ASRC:.S=.o)
NOLINK_OBJS = $(OTHER_CSRC:.c=.o) $(OTHER_ASRC:.S=.o)
DEPS = $(OBJS:.o=.d) $(NOLINK_OBJS:.o=.d)
BIN = $(TGT)
.PHONY: clean all
all: $(BIN)
debug:
$(INSIGHT) --se=$(TGT)
$(BIN): $(OBJS) $(NOLINK_OBJS)
$(CC) $(LDFLAGS) $(OBJS) $(LDLIBS) -o $@
clean:
rm -f $(DEPS)
rm -f $(OBJS) $(NOLINK_OBJS)
rm -f $(BIN)
# ---------------------------------------------------------------------------
# rules for code generation
# ---------------------------------------------------------------------------
%.o: %.c
$(CC) $(CFLAGS) -o $@ -c $<
%.o: %.S
$(CC) $(ASFLAGS) -o $@ -c $<
# ---------------------------------------------------------------------------
# # compiler generated dependencies
# ---------------------------------------------------------------------------
-include $(LWOS_DEPS) $(PORT_DEPS) $(APPL_DEPS)