what tools generate "qstr.i.last" file

C programming, build, interpreter/VM.
Target audience: MicroPython Developers.
Post Reply
User avatar
fkeujjpdc
Posts: 13
Joined: Thu Mar 23, 2017 3:17 am
Location: china

what tools generate "qstr.i.last" file

Post by fkeujjpdc » Mon Mar 27, 2017 2:08 am

How Generate qstr.i.last file , i found in makerules.mk
$(HEADER_BUILD)/qstr.i.last: $(SRC_QSTR) | $(HEADER_BUILD)/mpversion.h
$(ECHO) "GEN $@"
$(Q)if [ "$?" = "" ]; then \
echo "QSTR Looks like -B used, trying to emulate"; \
$(CPP) $(QSTR_GEN_EXTRA_CFLAGS) $(CFLAGS) $^ >$(HEADER_BUILD)/qstr.i.last; \
else \
$(CPP) $(QSTR_GEN_EXTRA_CFLAGS) $(CFLAGS) $? >$(HEADER_BUILD)/qstr.i.last; \
fi

but i can't find the CPP command,what is the CPP tools

User avatar
dhylands
Posts: 3821
Joined: Mon Jan 06, 2014 6:08 pm
Location: Peachland, BC, Canada
Contact:

Re: what tools generate "qstr.i.last" file

Post by dhylands » Mon Mar 27, 2017 3:33 am

CPP is the C pre-processor.

make provides a default definition of CPP which is defined to be $(CC) -E

You can see this if you do:

Code: Select all

2145 >make -p | grep -w CPP
CPP = $(CC) -E
	    $(CPP) $(QSTR_GEN_EXTRA_CFLAGS) $(CFLAGS) $^ >$(HEADER_BUILD)/qstr.i.last; \
	    $(CPP) $(QSTR_GEN_EXTRA_CFLAGS) $(CFLAGS) $? >$(HEADER_BUILD)/qstr.i.last; \
	$(Q)cat $(PY_QSTR_DEFS) $(QSTR_DEFS) $(QSTR_DEFS_COLLECTED) | $(SED) 's/^Q(.*)/"&"/' | $(CPP) $(CFLAGS) - | $(SED) 's/^"\(Q(.*)\)"/\1/' > $(HEADER_BUILD)/qstrdefs.preprocessed.h
CC is defined here: https://github.com/micropython/micropyt ... env.mk#L48

User avatar
fkeujjpdc
Posts: 13
Joined: Thu Mar 23, 2017 3:17 am
Location: china

Re: what tools generate "qstr.i.last" file

Post by fkeujjpdc » Tue Mar 28, 2017 12:50 am

Thanks, :D

Post Reply