-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
53 lines (37 loc) · 1.3 KB
/
Makefile
File metadata and controls
53 lines (37 loc) · 1.3 KB
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
# Wadim Mueller
# central makefile to build the app,
# all objects are build and placed in the corresponding subdirs by Makefile.build and then linked here
# currently i am not able to build relocatable files in the subdirs with g++ -r, thats the reason i need to search all objects via find
include Makefile.include
subdirs := filter/ decoder/ stereo-matcher/ stream/ utils/
clean_subdirs := $(addsuffix __clean,$(subdirs))
calibration_files := extrinsics.yml intrinsics.yml
obj-y += main.o estimator.o
target := rt-depth-map.elf
all-obj = $(sort $(patsubst ./%,%,$(shell find . -type f -name \*.o)))
.PHONY: all clean $(clean_subdirs)
all: $(target)
copy_to_target: clean all
ifeq ($(CROSS_COMPILE),)
@echo "need a cross compile build"
else
@echo "[CP] $(target) $(calibration_files) to $(ROOTFS)"
@cp $(target) $(calibration_files) $(ROOTFS)
endif
$(target): $(subdirs) $(obj-y)
@echo "[LD] $@ from $(all-obj)"
@$(CC) $(CFLAGS) -o $@ $(all-obj) $(LIBS)
clean: $(clean_subdirs)
@echo "[RM] /"
@rm -f *.o *.elf *.d
$(clean_subdirs):
@make $(SUBMAKE_ARGS) -f $(BUILD_MAKEFILE) obj=$(patsubst %__clean,%,$@) _clean
.PHONY: $(subdirs)
$(subdirs):
@make $(SUBMAKE_ARGS) -f $(BUILD_MAKEFILE) obj=$@ _all
%.o: %.cpp
@echo "[CC] $<"
@$(CC) $(CFLAGS) -c $< -o $@
%.d : ;
.PRECIOUS: %.d
-include $(obj-y:.o=.d)