-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
46 lines (35 loc) · 806 Bytes
/
Makefile
File metadata and controls
46 lines (35 loc) · 806 Bytes
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
# Flags
FLAGS := -Wall -Werror
NC := -lncursesw
LUA := -llua -lm -ldl
# Files lists
C_SRC := main.c cursedLua.c readSTDIN.c
C_OBJS := $(C_SRC:%.c=%.o)
LUA_SRC := evenmore.lua
LUA_OBJS := $(LUA_SRC:%.lua=%.luac)
# Install targets
TARGET_DIR := /usr/local/share/evenmorelua
TARGET_DIR_BIN := /usr/local/bin
TARGET_BIN := $(TARGET_DIR_BIN)/evenmorelua
# Commands
CC := gcc
CP := cp -f
RM := rm -rf
all : evenmorelua.bin
%.luac : %.lua
luac -o $@ $<
%.o : %.c
$(CC) -c $< $(FLAGS) -o $@
evenmorelua.bin : $(C_OBJS) $(LUA_OBJS)
$(CC) $(C_OBJS) $(FLAGS) $(NC) $(LUA) -o $@
install :
mkdir -p $(TARGET_DIR) $(TARGET_DIR_BIN)
$(CP) $(LUA_OBJS) $(TARGET_DIR)
$(CP) evenmorelua.bin $(TARGET_BIN)
uninstall :
$(RM) $(TARGET_DIR)
$(RM) $(TARGET_BIN)
clean :
$(RM) *.bin
$(RM) *.o
$(RM) *.luac