forked from hauspie/rflpc
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile.in
More file actions
45 lines (31 loc) · 974 Bytes
/
Makefile.in
File metadata and controls
45 lines (31 loc) · 974 Bytes
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
# This Makefile can be included in a project to ease the compiling
#
# You can find a Makefile example in samples/skel
# This includes the makefile that defines compiler tools
include $(RFLPC_DIR)/Makefile.vars
## Compiling variables
CFLAGS=$(shell $(RFLPC_DIR)/rflpc-config --cflags)
LDFLAGS=$(shell $(RFLPC_DIR)/rflpc-config --libs)
## Library configuration
MBED_PATH=$(shell mount | grep MBED | cut -d\ -f3)
# If your mount command is not completly compliant with the linux one, you can try to use awk instead of cut
#MBED_PATH=$(shell mount | grep MBED | awk '{ print $$3 }')
ELF=$(OUTPUT_NAME).elf
BIN=$(OUTPUT_NAME).bin
## Common rules
all: $(BIN)
$(BIN): $(ELF)
$(OBJCOPY) -O binary -j .text -j .data $^ $@
$(ELF): $(OBJS)
$(LD) -o $@ $(OBJS) $(LDFLAGS)
clean:
$(RM) *.o *~ rflpc.map
mrproper: clean
$(RM) $(ELF) $(BIN)
program: $(BIN)
cp $+ $(MBED_PATH) && sync
dump: $(ELF)
$(OBJDUMP) -sSt $^
$(RFLPC_DIR):
make -C $(RFLPC_DIR)
.DEFAULT: all