aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2020-04-16 18:44:48 +0200
committerJozanLeClerc <bousset.rudy@gmail.com>2020-04-16 18:44:48 +0200
commit7e831a1495736e3997502de43962d617b7218179 (patch)
treeb61da68e5e24f54523fecf68be0cce789a3c2a8c /Makefile
parentCreate LICENSE (diff)
downloadlowbat-bsd-7e831a1495736e3997502de43962d617b7218179.tar.gz
lowbat-bsd-7e831a1495736e3997502de43962d617b7218179.tar.bz2
lowbat-bsd-7e831a1495736e3997502de43962d617b7218179.tar.xz
lowbat-bsd-7e831a1495736e3997502de43962d617b7218179.tar.zst
lowbat-bsd-7e831a1495736e3997502de43962d617b7218179.zip
Read function is good
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile23
1 files changed, 15 insertions, 8 deletions
diff --git a/Makefile b/Makefile
index 4002515..06dddc7 100644
--- a/Makefile
+++ b/Makefile
@@ -6,9 +6,12 @@ C_SRCS_DIR = src
A_SRCS_DIR = asm
# =========================================== FILES ============================================== #
C_SRCS = ${C_SRCS_DIR}/jo_main.c
-C_SRCS += ${C_SRCS_DIR}/jo_printf.c
# ------------------------------------------------------------------------------------------------ #
C_OBJS = ${C_SRCS:.c=.o}
+# ------------------------------------------------------------------------------------------------ #
+A_SRCS = ${A_SRCS_DIR}/jo_f_status.asm
+# ------------------------------------------------------------------------------------------------ #
+A_OBJS = ${A_SRCS:.asm=.o}
# ========================================== COMPILER ============================================ #
CC = clang
# ------------------------------------------------------------------------------------------------ #
@@ -23,11 +26,13 @@ CFLAGS += ${DEBUG}
OPTI = -O2 -pipe
DEBUG = -glldb
# ------------------------------------------------------------------------------------------------ #
+LINK = -lc
+# ------------------------------------------------------------------------------------------------ #
TARGET = lowbat
# ========================================== ASSEMBLER =========================================== #
ASM = nasm
ASMFLAGS = -f
-ASMARCH = elf64_fbsd
+ASMARCH = elf64
# ============================================ UNIX ============================================== #
RM = rm -f
MKDIR = mkdir -p
@@ -36,13 +41,16 @@ MV = mv
SED = sed
# ============================================ RULES ============================================= #
-.SUFFIXES: .c .o
+.SUFFIXES: .asm .c .o
+
+.asm.o:
+ ${ASM} ${ASMFLAGS} ${ASMARCH} -o ${.TARGET} ${.IMPSRC}
.c.o:
- ${CC} -c ${CFLAGS} -I${C_SRCS_DIR} ${.IMPSRC} -o ${.TARGET}
+ ${CC} -c ${CFLAGS} -I${C_SRCS_DIR} -o ${.TARGET} ${.IMPSRC}
-${TARGET}: ${C_OBJS}
- ${CC} ${CFLAGS} -I${C_SRCS_DIR} -o ${.TARGET} ${.ALLSRC}
+${TARGET}: ${A_OBJS} ${C_OBJS}
+ ${CC} ${CFLAGS} -I${C_SRCS_DIR} -o ${.TARGET} ${.ALLSRC} ${LINK}
depend:
${CC} -I${C_SRCS_DIR} -E -MM ${C_SRCS} > .depend
@@ -53,6 +61,7 @@ all: depend ${TARGET}
clean:
${RM} ${C_OBJS}
+ ${RM} ${A_OBJS}
${RM} ${TARGET}.core
${RM} .depend
${RM} .depend.tmp
@@ -63,5 +72,3 @@ fclean: clean
re: fclean all
.PHONY: all clean fclean re depend
-
--include "./.depend"