-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathMakefile.dist
67 lines (49 loc) · 2.06 KB
/
Makefile.dist
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
### ==========================================================================
### $Id$
### FILE: Makefile.dist - make the Lego Programs
### bibo - another LEGO Mindstorms OS
### --------------------------------------------------------------------------
# NOTE: When installed via "make install", this file is renamed and included as just "Makefile"
# IMPORTANT: Do not modify the commented placeholder line below without also updating the "install" target in the main Makefile.
# installation paths
# name for the kernel
KERNEL = $(DATADIR)/$(PACKAGE)
SOURCES?=helloworld.c
PROGRAMS?=$(filter %.lx, $(SOURCES:%.c=%.lx) $(SOURCES:%.cpp=%.lx) \
$(SOURCES:%.s=%.lx) $(SOURCES:%.S=%.) \
$(SOURCES:%.strl=%.lx) )
# extra dynamic sources - program name (e.g. helloworld.c/.cpp) is always assumed
helloworld_SRC?=
COPT = -g -Os -fno-builtin -fomit-frame-pointer
CWARN = -Wall
CINC = -I$(INCLUDEDIR)
CFLAGS = $(COPT) $(CWARN) $(CINC)
CROSSCFLAGS = $(COPT) -mquickcall $(CWARN) $(CINC) $(CDEFINES)
CROSSCXXFLAGS = -DCXX -fno-rtti -fno-exceptions $(CROSSCFLAGS)
CROSSAS = $(CROSSTOOLPREFIX)as
CROSSAR = $(CROSSTOOLPREFIX)ar
CROSSLD = $(CROSSTOOLPREFIX)ld
CROSSNM = $(CROSSTOOLPREFIX)nm
CROSSOBJCOPY = $(CROSSTOOLPREFIX)objcopy
CROSSOBJDUMP = $(CROSSTOOLPREFIX)objdump
CROSSCC = $(CROSSTOOLPREFIX)gcc
CROSSCXX = $(CROSSTOOLPREFIX)g++
WRITELX = $(BINDIR)/writelx
include $(DATADIR)/Makefile.user
all:: $(PROGRAMS)
TAGS:
-etags *.c $(DATADIR)/include/*.h ../include/*/*.h
clean::
rm -f *.o *.dis *.dis2 *.s *.ds1 *.ds2 *.dmap *.dcoff
rm -f *.srec *.coff
realclean:: clean
rm -f *~ *.bak *.lx *.a TAGS
.PHONY: all clean realclean
# depencencies
#
SRC = $(foreach $prog,$(PROGRAMS:%.lx=%),$($(prog)_SRC))
OBJS = $(filter %.o,$(SRC:%.c=%.o) $(SRC:%.cpp=%.o) $(SRC:%.s=%.o) $(SRC:%.S=%.o) $(SRC:%.strl=%.o) )
-include $(PROGRAMS:%.lx=%.d) $(OBJS:%.o=%.d)
### --------------------------------------------------------------------------
### End of FILE: demo/Makefile
### ==========================================================================