2006-11-28 03:23:25 +03:00
|
|
|
INCLUDE = include
|
2007-10-15 13:42:17 +04:00
|
|
|
LIBSFORBUILD = math
|
|
|
|
LIBNAME = libck.a
|
2006-11-28 03:23:25 +03:00
|
|
|
CC = gcc
|
2008-01-14 22:33:34 +03:00
|
|
|
CFLAGS = -I$(INCLUDE) -m32 -nostdinc -nostdlib -DGNUC
|
2007-10-15 13:42:17 +04:00
|
|
|
DIRS := stdio kolibrisys string stdlib memory math
|
2006-11-28 03:23:25 +03:00
|
|
|
|
|
|
|
##############################################################
|
|
|
|
#files := $(foreach dir,$(DIRS),$(dir)/$(wildcard $(dir)/*))
|
|
|
|
asmfiles := $(foreach dir,$(DIRS),$(patsubst %.asm, %.o, $(wildcard $(dir)/*.asm)))
|
|
|
|
cfiles := $(foreach dir,$(DIRS),$(patsubst %.c, %.o, $(wildcard $(dir)/*.c)))
|
|
|
|
|
|
|
|
.PHONY: clean all
|
|
|
|
|
2006-12-01 13:55:54 +03:00
|
|
|
ifdef windir
|
|
|
|
doClean = del /F /Q $(subst /,\,$(cfiles)) $(subst /,\,$(asmfiles))
|
|
|
|
else
|
|
|
|
doClean = rm $(cfiles) $(asmfiles)
|
|
|
|
endif
|
|
|
|
|
2006-11-28 03:23:25 +03:00
|
|
|
all: $(cfiles) $(asmfiles)
|
|
|
|
ar -ru $(LIBNAME) $^
|
|
|
|
|
|
|
|
$(cfiles): $(INCLUDE)/*.h
|
|
|
|
|
|
|
|
$(asmfiles):
|
|
|
|
fasm $*.asm $*.o
|
|
|
|
|
|
|
|
clean:
|
2006-12-01 13:55:54 +03:00
|
|
|
$(doClean)
|