aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile29
-rw-r--r--src/c_fork.c3
-rw-r--r--src/c_fork.h0
3 files changed, 16 insertions, 16 deletions
diff --git a/Makefile b/Makefile
index 1ab361a..37ebdbd 100644
--- a/Makefile
+++ b/Makefile
@@ -19,17 +19,18 @@
default: all
SRCS_DIR := src
-OBJS_DIR := obj
+# OBJS_DIR := obj
PREFIX ?= /usr/local/
DESTDIR :=
MAKEOBJDIR := ./
-SRCS = c_bsdsetsid
+SRCS := c_bsdsetsid
+SRCS += c_fork
SRCS := ${SRCS:S/$/.c/g}
SRCS := ${SRCS:S/^/${SRCS_DIR}\//g}
OBJS := ${SRCS:=.o}
-OBJS := ${SRCS:S/${SRCS_DIR}/${OBJS_DIR}/g}
+# OBJS := ${OBJS:S/${SRCS_DIR}/${OBJS_DIR}/g}
INCS := ${SRCS:.c=.h}
@@ -47,28 +48,24 @@ MKDIR := mkdir -p
SED := sed -i ''
.OBJDIR: ./
-.SUFFIXES: .c.o .c
-.c.c.o:
+.SUFFIXES: .c.o .o
+
+.c.c.o: ${INCS}
${CC} -c ${CFLAGS} -o ${.TARGET} ${.IMPSRC}
${NAME}: ${OBJS}
${CC} ${CFLAGS} -o ${.TARGET} ${.ALLSRC}
-${OBJS_DIR}:
- ${MKDIR} ${OBJS_DIR}
-
-.depend:
- ${CC} -I${SRCS_DIR} -E -MM ${SRCS} > .depend
- ${SED} 's/^/${OBJS_DIR}\//g' .depend
- ${SED} 's/\.o/\.c.o/g' .depend
+# ${OBJS_DIR}:
+ # ${MKDIR} ${OBJS_DIR}
-all: .depend ${OBJS_DIR} ${NAME}
+all: ${OBJS_DIR} ${NAME}
clean:
- ${RM} ${OBJS} ${NAME} .depend vgcore*
- ${RM} -R obj
+ ${RM} ${OBJS} ${NAME} vgcore*
+ # ${RM} -R ${OBJS_DIR}
-.PHONY: all clean .depend
+.PHONY: all clean depend
# Files prefixes index
# --------------------
diff --git a/src/c_fork.c b/src/c_fork.c
new file mode 100644
index 0000000..e222cda
--- /dev/null
+++ b/src/c_fork.c
@@ -0,0 +1,3 @@
+#include <unistd.h>
+
+#include "c_bsdsetsid.h"
diff --git a/src/c_fork.h b/src/c_fork.h
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/src/c_fork.h