-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
73 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule source
added at
902bf6
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
**/bin | ||
**/lib |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
cyan = /bin/echo -e "\x1b[36m\#\# $1\x1b[0m" | ||
|
||
# Project Root | ||
override HOME = ../.. | ||
|
||
# Project Resources | ||
SYSROOT = $(HOME)/../../../../sysroot | ||
INCLUDE = $(SYSROOT)/usr/include | ||
LIBRARIES = $(SYSROOT)/usr/lib | ||
SOURCE = $(HOME)/source | ||
TOOLS = $(HOME)/../../tools | ||
BIN = bin/usr/bin | ||
LIB = lib | ||
|
||
# Tools Config | ||
CFLAGS = -Werror | ||
|
||
LDFLAGS = -Wall \ | ||
-lc | ||
|
||
# Recursive Wild Card | ||
rwildcard = $(foreach d,$(wildcard $(1:=/*)),$(call rwildcard,$d,$2) $(filter $(subst *,%,$2),$d)) | ||
|
||
# Source Files | ||
C_SRC = $(call rwildcard,$(SOURCE),*.c) | ||
|
||
OBJS = $(patsubst $(SOURCE)/%.c,$(LIB)/%_c.o,$(C_SRC)) | ||
|
||
# Target | ||
$(LIB)/%_c.o: $(SOURCE)/%.c | ||
@ mkdir -m 777 -p $(@D) | ||
@ $(call cyan,"$(subst ../,,$^)") | ||
@ $(CC) $(CFLAGS) -c $^ -o $@ | ||
|
||
git: | ||
@ rm -rf $(SOURCE) | ||
@ cd $(HOME) && git clone https://github.com/kot-org/lua source | ||
|
||
compile: | ||
@ cd $(SOURCE) && make all | ||
|
||
copy_to_sysroot: | ||
@ mkdir -m 777 -p $(BIN) | ||
@ cp $(SOURCE)/lua $(BIN) | ||
|
||
build: git compile copy_to_sysroot |