-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathMakefile
More file actions
48 lines (37 loc) · 1.29 KB
/
Makefile
File metadata and controls
48 lines (37 loc) · 1.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# PyMite Configuration
PLATFORM := $(notdir $(CURDIR))
PM_LIB_ROOT = pmvm_$(PLATFORM)
PM_LIB_FN = lib$(PM_LIB_ROOT).a
PM_LIB_PATH = ../../vm/$(PM_LIB_FN)
PM_USR_SOURCES = main.py
PM_HEAP_SIZE = 0x2000
PMIMGCREATOR := ../../tools/pmImgCreator.py
PMGENPMFEATURES := ../../tools/pmGenPmFeatures.py
IPM = true
DEBUG = true
TARGET = main
SOURCES = $(TARGET).c plat.c $(TARGET)_nat.c $(TARGET)_img.c
OBJS = $(SOURCES:.c=.o)
CINCS = -I$(abspath .) -I../../vm
ifeq ($(DEBUG),true)
CDEBUGS += -g -D__DEBUG__=1
else
CDEBUGS += -Os
endif
CFLAGS = -Wall -fno-strict-aliasing -Wstrict-prototypes \
-Wdeclaration-after-statement -Werror $(CDEBUGS) $(CINCS)
export CFLAGS IPM PM_LIB_FN
.PHONY: all clean
all : pmfeatures.h $(TARGET).out
$(PM_LIB_PATH) : ../../vm/*.c ../../vm/*.h
make -C ../../vm
$(TARGET).out : $(OBJS) $(PM_LIB_PATH)
$(CC) -o $@ $(OBJS) $(PM_LIB_PATH) -lm
pmfeatures.h : pmfeatures.py $(PMGENPMFEATURES)
$(PMGENPMFEATURES) pmfeatures.py > $@
# Generate native code and module images from the python source
$(TARGET)_nat.c $(TARGET)_img.c: $(PM_USR_SOURCES) pmfeatures.py
$(PMIMGCREATOR) -f pmfeatures.py -c -u -o $(TARGET)_img.c --native-file=$(TARGET)_nat.c $(PM_USR_SOURCES)
clean :
$(MAKE) -C ../../vm clean
$(RM) $(TARGET).out $(OBJS) $(TARGET)_img.* $(TARGET)_nat.* pmfeatures.h