libk  Diff

Differences From Artifact [86d81e4675]:

To Artifact [3c50b488d5]:


     4      4   # vim: ft=make
     5      5   
     6      6   mod = $(notdir $(PWD))
     7      7   src = $(wildcard *.c) $(wildcard *.s)
     8      8   bare = $(mod:k%=%)
     9      9   headers = $(wildcard *.h) $(gen-headers)
    10     10   
    11         -tools    = $(filter     exe.%.c,   $(src))
    12         -nontools = $(filter-out exe.%.c,   $(src))
           11  +tools    = $(filter     %.exe.c,   $(src))
           12  +nontools = $(filter-out %.exe.c,   $(src))
    13     13   cobjects = $(filter     %.c,       $(nontools))
    14     14   sobjects = $(filter %.${TARGET}.s, $(nontools))
    15     15   
    16     16   cflags = -isystem ${OUT} -fPIC -nostdlib ${COMPLIB} -L${OUT} -lk
    17     17   
    18     18   obj: $(cobjects:%.c=${OUT}/$(mod).%.o) \
    19     19   	 $(sobjects:%.s=${OUT}/$(mod).%.o)
    20         -tool: $(tools:exe.%.c=${OUT}/$(mod).%) \
           20  +tool: $(tools:%.exe.c=${OUT}/$(mod).%) \
    21     21   	  ${OUT}/libk.a
    22     22   
    23     23   def: $(headers:%=${OUT}/k/%)
    24     24   
    25     25   dbg:
    26     26   	@echo tools = $(tools)
    27     27   	@echo TARGET = ${TARGET}
................................................................................
    32     32   
    33     33   ${OUT}/$(mod).%.o: %.c
    34     34   	$(CC) $(cflags) -c $< -o $@
    35     35   
    36     36   ${OUT}/k/%.h: %.h
    37     37   	cp $< $@
    38     38   
    39         -${OUT}/$(mod).%: exe.%.c
           39  +${OUT}/$(mod).%: %.exe.c
    40     40   	$(CC) $(cflags) $< -o $@
    41     41   
    42     42   ${TMP}:
    43     43   	mkdir -p ${TMP}
    44     44   
    45     45   #- assembly
    46     46   # compiling  the assembly  code will  be  faster but  a lot  more