-
Notifications
You must be signed in to change notification settings - Fork 3
Makefile note
###############################################################################
###############################################################################
include ../py/mkenv.mk
PROG = cpy # what is PROG?
include ../py/py.mk
INC = -I. # add current dir as include dir INC += -I.. # add .. as include dir INC += -I$(BUILD) # BUILD is defined in ../py/mkenv.mk
CFLAGS = $(INC) -Wall -Wpointer-arith -Werror -ansi -std=gnu99 -DUNIX # add a '#define UNIX'. # I greped 'UNIX' and it seemed that it is not used. # I commented it out and it seemed okay.
LDFLAGS = -lm # link math library
ifdef DEBUG # where is DEBUG defined? CFLAGS += -O0 -g else CFLAGS += -Os
SRC_C =
main.c
# set source file
OBJ =
include ../py/mkrules.mk
###############################################################################
###############################################################################
ifneq (
THIS_MAKEFILE :=
TOP :=
ifeq ("$(origin V)", "command line") BUILD_VERBOSE=$(V) endif # if the user added a V option in command line (-V=1)
ifndef BUILD_VERBOSE BUILD_VERBOSE = 0 endif # set BUILD_VERBOSE
ifeq ($(BUILD_VERBOSE), 0) Q = @ else Q = endif # @ disable command line output.
ifeq (
PY_SRC ?= $(TOP)/py # ?= only set when the variable doesn't have a value yet BUILD ?= build
RM = rm ECHO = @echo CP = cp MKDIR = mkdir SED = sed PYTHON = python
AS =
all: # a rule called all .PHONY: all
.DELETE_ON_ERROR:
MKENV_INCLUDED = 1
###############################################################################
###############################################################################
PY_BUILD = $(BUILD)/py # every C file ../py/.c will be compiled to build/py/.o
HEADER_BUILD = $(BUILD)/genhdr # some auto-generated header files will be put in build/genhdr
PY_QSTR_DEFS = $(PY_SRC)/qstrdefs.h # ../py/qstrdefs.h
CSUPEROPT = -O3 # level 3 optimization
PY_O_BASENAME =
mpstate.o
nlrx86.o
nlrx64.o
nlrthumb.o
nlrxtensa.o
nlrsetjmp.o
malloc.o
gc.o
qstr.o
vstr.o
mpprint.o
unicode.o
mpz.o
lexer.o
lexerstr.o
lexerunix.o
parse.o
scope.o
compile.o
emitcommon.o
emitcpy.o
emitbc.o
asmx64.o
emitnx64.o
asmx86.o
emitnx86.o
asmthumb.o
emitnthumb.o
emitinlinethumb.o
asmarm.o
emitnarm.o
formatfloat.o
parsenumbase.o
parsenum.o
emitglue.o
runtime.o
nativeglue.o
stackctrl.o
argcheck.o
warning.o
map.o
obj.o
objarray.o
objattrtuple.o
objbool.o
objboundmeth.o
objcell.o
objclosure.o
objcomplex.o
objdict.o
objenumerate.o
objexcept.o
objfilter.o
objfloat.o
objfun.o
objgenerator.o
objgetitemiter.o
objint.o
objint_longlong.o
objint_mpz.o
objlist.o
objmap.o
objmodule.o
objobject.o
objproperty.o
objnone.o
objnamedtuple.o
objrange.o
objreversed.o
objset.o
objsingleton.o
objslice.o
objstr.o
objstrunicode.o
objstringio.o
objtuple.o
objtype.o
objzip.o
opmethods.o
sequence.o
stream.o
binary.o
builtinimport.o
builtinevex.o
modarray.o
modbuiltins.o
modcollections.o
modgc.o
modio.o
modmath.o
modcmath.o
modmicropython.o
modstruct.o
modsys.o
vm.o
bc.o
showbc.o
repl.o
smallint.o
frozenmod.o
../extmod/moductypes.o
../extmod/modujson.o
../extmod/modure.o
../extmod/moduzlib.o
../extmod/moduheapq.o
../extmod/moduhashlib.o
../extmod/modubinascii.o
../extmod/modmachine.o \
# These are the .o files
# What .c files are they from?
PY_O =
FORCE: .PHONY: FORCE
$(Q)$(PYTHON) $(PY_SRC)/makeversionhdr.py $@
# This is the actual command for $(HEADER_BUILD)/mpversion.h:
# ../py/makeversionhdr.py <arguments>
# Where do the arguments come from?
MPCONFIGPORT_MK = $(wildcard mpconfigport.mk) # MPCONFIGPORT_MK == mpconfigport.mk if mpconfigport.mk exists
###############################################################################
###############################################################################
ifneq (
vpath %.S .
vpath %.s .
define compile_c
$(SED) -e 's/#.//' e 's/^.': *//' -c 's/ *\$$//'
-e '/^$$/ d' -e 's/$$/ :/' <
vpath %.c .