@@ -1,8 +1,10 @@ #- modmake # this is the master makefile that controls the building of each # libk module. it is included from each k*/makefile. # vim: ft=make + +include ../makerule mod = $(notdir $(PWD)) src = $(wildcard *.c) $(wildcard *.s) $(filter-out %.h,$(patsubst %.m,%,$(wildcard *.m))) bare = $(mod:k%=%) @@ -12,20 +14,8 @@ nontools = $(filter-out %.exe.c, $(src)) cobjects = $(filter %.c, $(nontools)) sobjects = $(filter %.${TARGET}.s, $(nontools)) -cflags = -std=c11 -isystem ${OUT} -isystem ${TMP} -isystem ${ROOT}/arch -fPIC -nostdlib ${COMPLIB} -L${OUT} - -m-env = atom_target_arch=${ARCH} -m-env += atom_target_os=${OS} -ifneq (${BITS},) #!!! ifdef does NOT work with environment variables - m-env += atom_target_bits=${BITS} -endif -m-env += target_posix=${POSIX} -m-env += target_unix=${UNIX} - -m-comp = ${m4} $(m-env:%=-D%) - obj: $(cobjects:%.c=${OUT}/$(mod).%.o) \ $(sobjects:%.s=${OUT}/$(mod).%.o) tool: $(tools:%.exe.c=${OUT}/$(mod).%) \ ${OUT}/libk.a