-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
51 lines (35 loc) · 940 Bytes
/
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
# Makefile to make the mkrom tool and associated libraries.
CC=gcc
AR=ar
CFLAGS=-Wall -fPIC -fvisibility=hidden
INCLUDE=-I/usr/include/lua5.3
AUTO_GEN= .lua_src.c
LIB_SRC= romfs.c \
luaromfs.c \
sha256.c \
aes.c
LIB_HDR= romfs.h \
luaromfs.h \
sha256.h \
aes.h
BIN_SRC= mkrom.c \
sha256.c \
aes.c
BIN_HDR= sha256.h \
aes.h
all: mkrom libluaromfs.a example
mkrom: Makefile ${BIN_SRC} ${BIN_HDR}
${CC} ${CFLAGS} -o $@ ${BIN_SRC} -lz
libluaromfs.a: Makefile ${AUTO_GEN} ${LIB_SRC} ${LIB_HDR}
${CC} ${CFLAGS} ${INCLUDE} -c ${LIB_SRC}
${AR} rcs libluaromfs.a $(patsubst %.c,%.o,${LIB_SRC})
.PHONY: always
.lua_src.c: mkrom always
./mkrom -c lua_src -s -x lua_src/ lua_src/ .lua_src.c
.PHONY: clean distclean example
example: mkrom libluaromfs.a
cd example && make && ./example
clean:
rm -f *.o ${AUTO_GEN}
distclean: clean
rm -f mkrom libluaromfs.a