forked from citrus-it/picube
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
89 lines (69 loc) · 1.43 KB
/
Makefile
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
MAKE=make
DEFS=-DPICUBE
SRCS= anim.c \
canary.c \
cube.c \
gpio.c \
jim.c \
main.c \
sprite.c \
text.c \
util.c
HDRS= cube.h \
gpio.h \
jim.h \
sprite.h \
tables.h \
text.h \
util.h
OBJS= $(SRCS:.c=.o)
CC=gcc
CFLAGS=-g
INCS=-I. -Ijimtcl
LIBS=-lpthread -lm -ldl
#CFLAGS=-g -O3 -fno-strict-aliasing
#WARN=-pedantic -Wall -Wnested-externs -Wpointer-arith -Werror -Wno-unused
#WARN=-pedantic -Wall -W -Wnested-externs -Wpointer-arith -Wno-long-long
all: cube
cube: jimtcl/libjim.a ${OBJS}
${CC} -static-libgcc \
${WARN} \
${DEFS} \
${CFLAGS} -o $@ \
${OBJS} \
${LIBS} jimtcl/libjim.a jimtcl/initjimsh.o
@echo "Done..."
jimtcl/libjim.a:
cd jimtcl; \
CFLAGS=-DPICUBE ./configure \
--math \
--disable-docs \
--with-ext="oo tree"; \
make
install: cube
sudo cp cube /usr/local/bin/cube
clean:
@-touch core
rm -f cube core tags ${OBJS} help.h ext.h anim.h
distclean: clean
cd jimtcl; make clean distclean
tags:
@-ctags *.[ch] 2>> /dev/null
# Relax C rules for anim.c to provide compatibility with ChipKit code.
anim.o: anim.c anim.h
@echo " $<"
@$(CC) -std=gnu99 $(CFLAGS) ${WARN} ${DEFS} ${INCS} -c $< -o $@
.c.o:
@echo " $<"
@$(CC) $(CFLAGS) ${WARN} ${DEFS} ${INCS} -c $< -o $@
anim.h: anim/build
@echo " $@"
@cd anim; ./build > ../anim.h
help.h: help/build
@echo " $@"
@cd help; ./build > ../help.h
ext.h: ext/build
@echo " $@"
@cd ext; ./build > ../ext.h
jim.o: help.h ext.h
${OBJS}: ${HDRS}