linux/debian/build/scripts/mod/Makefile.real

22 lines
835 B
Makefile

PROGS = modpost.real-$(TYPE)
top_srcdir = ../..
include $(top_srcdir)/debian/build/Makefile.inc
modpost.real-$(TYPE): file2alias.real-$(TYPE).o modpost.real-$(TYPE).o sumversion.real-$(TYPE).o
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^
%.real-$(TYPE).o: $(SOURCEDIR)/%.c real-$(TYPE)/devicetable-offsets.h
$(CC) -I real-$(TYPE) $(CFLAGS) -c -o $@ $<
real-$(TYPE)/devicetable-offsets.s: $(SOURCEDIR)/devicetable-offsets.c
$(CC) -include real-$(TYPE)/types.h $(CFLAGS) -nostdinc -I$(top_srcdir)/include -S -o $@ $<
real-$(TYPE)/devicetable-offsets.h: real-$(TYPE)/devicetable-offsets.s
echo >$@ "#define __DEVICEVTABLE_OFFSETS_H__"
sed -ne "/^->/{s:->#\(.*\):/* \1 */:; \
s:^->\([^ ]*\) [\$$#]*\([-0-9]*\) \(.*\):#define \1 \2 /* \3 */:; \
s:^->\([^ ]*\) [\$$#]*\([^ ]*\) \(.*\):#define \1 \2 /* \3 */:; \
s:->::; p;}" $< >>$@