make make clean
work again
the irq2nvic_h generates files in a way make doesn't understand, so it now also provides an option to clean up again
This commit is contained in:
parent
2ad04777bf
commit
efce73f815
8
Makefile
8
Makefile
@ -45,6 +45,12 @@ generatedheaders:
|
|||||||
./scripts/irq2nvic_h $$yamlfile ; \
|
./scripts/irq2nvic_h $$yamlfile ; \
|
||||||
done
|
done
|
||||||
|
|
||||||
|
cleanheaders:
|
||||||
|
@printf " CLEANING HEADERS\n"
|
||||||
|
$(Q)for yamlfile in `find -name 'irq.yaml'`; do \
|
||||||
|
./scripts/irq2nvic_h --remove $$yamlfile ; \
|
||||||
|
done
|
||||||
|
|
||||||
lib: generatedheaders
|
lib: generatedheaders
|
||||||
$(Q)for i in $(addprefix $@/,$(TARGETS)); do \
|
$(Q)for i in $(addprefix $@/,$(TARGETS)); do \
|
||||||
if [ -d $$i ]; then \
|
if [ -d $$i ]; then \
|
||||||
@ -77,7 +83,7 @@ install: lib
|
|||||||
doc:
|
doc:
|
||||||
$(Q)$(MAKE) -C doc doc
|
$(Q)$(MAKE) -C doc doc
|
||||||
|
|
||||||
clean:
|
clean: cleanheaders
|
||||||
$(Q)for i in $(addprefix lib/,$(TARGETS)) \
|
$(Q)for i in $(addprefix lib/,$(TARGETS)) \
|
||||||
$(addsuffix /*/*,$(addprefix examples/,$(TARGETS))); do \
|
$(addsuffix /*/*,$(addprefix examples/,$(TARGETS))); do \
|
||||||
if [ -d $$i ]; then \
|
if [ -d $$i ]; then \
|
||||||
|
@ -130,12 +130,22 @@ def needs_update(infiles, outfiles):
|
|||||||
return any(not os.path.exists(o) for o in outfiles) or max(map(timestamp, infiles)) > min(map(timestamp, outfiles))
|
return any(not os.path.exists(o) for o in outfiles) or max(map(timestamp, infiles)) > min(map(timestamp, outfiles))
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
if sys.argv[1] == '--remove':
|
||||||
|
remove = True
|
||||||
|
del sys.argv[1]
|
||||||
|
else:
|
||||||
|
remove = False
|
||||||
infile = sys.argv[1]
|
infile = sys.argv[1]
|
||||||
if not infile.startswith('./include/libopencm3/') or not infile.endswith('/irq.yaml'):
|
if not infile.startswith('./include/libopencm3/') or not infile.endswith('/irq.yaml'):
|
||||||
raise ValueError("Arguent must match ./include/libopencm3/**/irq.yaml")
|
raise ValueError("Arguent must match ./include/libopencm3/**/irq.yaml")
|
||||||
nvic_h = infile.replace('irq.yaml', 'nvic.h')
|
nvic_h = infile.replace('irq.yaml', 'nvic.h')
|
||||||
vector_nvic_c = infile.replace('./include/libopencm3/', './lib/').replace('irq.yaml', 'vector_nvic.c')
|
vector_nvic_c = infile.replace('./include/libopencm3/', './lib/').replace('irq.yaml', 'vector_nvic.c')
|
||||||
|
|
||||||
|
if remove:
|
||||||
|
os.unlink(nvic_h)
|
||||||
|
os.unlink(vector_nvic_c)
|
||||||
|
sys.exit(0)
|
||||||
|
|
||||||
if not needs_update([__file__, infile], [nvic_h, vector_nvic_c]):
|
if not needs_update([__file__, infile], [nvic_h, vector_nvic_c]):
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user