blob: 07889e92e2f4372a12a536efbe344eec4d35584d (
plain)
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
|
default: all
SHELL := /bin/sh
# ============================================ DIRS ============================================== #
SRCS_DIR = src
ASRCS_DIR = asm
# ------------------------------------------------------------------------------------------------ #
OBJS_DIR = cobj
AOBJS_DIR = asmobj
# =========================================== FILES ============================================== #
SRCS = ${SRCS_DIR}/jo_main.c
SRCS += ${SRCS_DIR}/jo_printf.c
# ========================================== COMPILER ============================================ #
CC = clang
# ------------------------------------------------------------------------------------------------ #
CFLAGS = -std=c89
CFLAGS += -Wall
CFLAGS += -Wextra
CFLAGS += -Werror
CFLAGS += -pedantic
# CFLAGS += -O2 -pipe
# ------------------------------------------------------------------------------------------------ #
NAME = lowbat
# ========================================== ASSEMBLER =========================================== #
ASM = nasm
ASMFLAGS = -f
ASMARCH = elf64_fbsd
# ============================================ UNIX ============================================== #
RM = rm -rf
MKDIR = mkdir -p
CP = cp
MV = mv
AWK = awk -F
SED = sed
# ============================================ RULES ============================================= #
depend:
${CC} -I${SRCS_DIR}/ -E -MM ${SRCS} > .depend
${SED} 's/^/${OBJS_DIR}\//' .depend > .depend.tmp
${MV} .depend.tmp .depend
${MKDIR} ${OBJS_DIR}
all: depend
# .include "./.depend"
clean:
${RM} ${OBJS_DIR}
${RM} ${AOBJS_DIR}
${RM} ${NAME}.core
${RM} .depend
${RM} .depend.tmp
fclean: clean
${RM} ${NAME}
re: fclean all
.PHONY: all clean fclean re depend config
|