mirror of
https://github.com/KolibriOS/kolibrios.git
synced 2024-12-12 01:53:58 +03:00
48ecbd9104
It is added makefile for compilation of programs under KolibriOS with the help gcc. git-svn-id: svn://kolibrios.org@696 a494cfbc-eb01-0410-851d-a64ba20cac60
31 lines
764 B
Makefile
31 lines
764 B
Makefile
INCLUDE = include
|
|
LIBSFORBUILD = math
|
|
LIBNAME = libck.a
|
|
CC = gcc
|
|
CFLAGS = -I$(INCLUDE) -m32 -nostdinc -nostdlib -DGNUC
|
|
DIRS := stdio kolibrisys string stdlib memory math
|
|
|
|
##############################################################
|
|
#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
|
|
|
|
ifdef windir
|
|
doClean = del /F /Q $(subst /,\,$(cfiles)) $(subst /,\,$(asmfiles))
|
|
else
|
|
doClean = rm $(cfiles) $(asmfiles)
|
|
endif
|
|
|
|
all: $(cfiles) $(asmfiles)
|
|
ar -ru $(LIBNAME) $^
|
|
|
|
$(cfiles): $(INCLUDE)/*.h
|
|
|
|
$(asmfiles):
|
|
fasm $*.asm $*.o
|
|
|
|
clean:
|
|
$(doClean)
|