https://bitbucket.org/hudson/magic-lantern
Revision 6f008aec4803609eeb63c95114d8b78c789615d6 authored by a1ex on 30 August 2013, 12:38:38 UTC, committed by a1ex on 30 August 2013, 12:38:38 UTC
Stop tracking autogenerated files in the Mercurial repo
2 parent s 37790a3 + de0a57e
Raw File
Tip revision: 6f008aec4803609eeb63c95114d8b78c789615d6 authored by a1ex on 30 August 2013, 12:38:38 UTC
Merged in Pelican/7d (pull request #209)
Tip revision: 6f008ae
Makefile.filerules

#
# generate dependencies
#
COBJS := $(filter %.o, $(ML_OBJS-y))
DEPS  := $(COBJS:.o=.d)
-include $(DEPS)

all::

#
#
# file type rules
#
#
%.s: %.c
	$(call build,CC -S,$(CC) $(CFLAGS) -S -o $@ $<)
%.sym: %
	$(call build,SYMBOLS,$(READELF) -sW $< | $(GREP) GLOBAL | $(GREP) -E 'FUNC|OBJECT|ABS' | $(AWK) '{print $$2 " " $$8;}' | $(GREP) -v '^ ' | $(GREP) -v __config_ | $(GREP) -v -E ' _[a-zA-Z]' | sort > $@)
%.o: $(PLATFORM_DIR)/%.c
	$(call build,CC,$(CC) $(CFLAGS) -c -o $@ $<)
%.o: $(SRC_DIR)/%.c
	$(call build,CC,$(CC) $(CFLAGS) -c -o $@ $<)
%.o: $(PICOC_PATH)/%.c
	$(call build,CC,$(CC) $(CFLAGS) -c -mthumb -fwhole-program -o $@ $<)
%.i: %.c
	$(call build,CPP,$(CC) $(CFLAGS) -E -c -o $@ $<)
%: %.c
	$(call build,LD,$(CC) $(CFLAGS) -o $@ $<)
%.o: $(PLATFORM_DIR)/%.S
	$(call build,AS,$(CC) $(AFLAGS) -c -o $@ $<)
%.o: $(SRC_DIR)/%.S
	$(call build,AS,$(CC) $(AFLAGS) -c -o $@ $<)
%.o: %.c
	$(call build,CC,$(CC) $(CFLAGS) -c -o $@ $<)
%.bin: %
	$(call build,OBJCOPY,$(OBJCOPY) -O binary $< $@)
	$(call build,STAT,$(STAT_CMD) $@)

%-stubs.S: %.map
	perl -ne > $@ < $< 'BEGIN { print "#define SYM(a,n) n=a; .global n;\n" } s/[\r\n]//g; s/^\s*0001:([0-9A-Fa-f]+)\s+([^\s]+)$$/SYM(0x\1,\2)\n/ and print;'

%.dis: %.bin
	$(OBJDUMP) \
		-b binary \
		-m arm \
		-D \
		$< \
	> $@
back to top