Rev 647 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
222 | victor | 1 | INCLUDE = include |
647 | andrew_pro | 2 | LIBSFORBUILD = math |
3 | LIBNAME = libck.a |
||
222 | victor | 4 | CC = gcc |
696 | andrew_pro | 5 | CFLAGS = -I$(INCLUDE) -m32 -nostdinc -nostdlib -DGNUC |
647 | andrew_pro | 6 | DIRS := stdio kolibrisys string stdlib memory math |
222 | victor | 7 | |
8 | ############################################################## |
||
9 | #files := $(foreach dir,$(DIRS),$(dir)/$(wildcard $(dir)/*)) |
||
10 | asmfiles := $(foreach dir,$(DIRS),$(patsubst %.asm, %.o, $(wildcard $(dir)/*.asm))) |
||
11 | cfiles := $(foreach dir,$(DIRS),$(patsubst %.c, %.o, $(wildcard $(dir)/*.c))) |
||
12 | |||
13 | .PHONY: clean all |
||
14 | |||
225 | victor | 15 | ifdef windir |
16 | doClean = del /F /Q $(subst /,\,$(cfiles)) $(subst /,\,$(asmfiles)) |
||
17 | else |
||
18 | doClean = rm $(cfiles) $(asmfiles) |
||
19 | endif |
||
20 | |||
222 | victor | 21 | all: $(cfiles) $(asmfiles) |
22 | ar -ru $(LIBNAME) $^ |
||
23 | |||
24 | $(cfiles): $(INCLUDE)/*.h |
||
25 | |||
26 | $(asmfiles): |
||
27 | fasm $*.asm $*.o |
||
28 | |||
29 | clean: |
||
225 | victor | 30 | $(doClean) |