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