VERSION = 1.1

CFLAGS = -Wall -g -DVERSION=\"$(VERSION)\" -fno-builtin

ARCH := $(patsubst i%86,i386,$(shell uname -m))
ifeq (i386,$(ARCH))
MINILIBC=minilibc.o
CFLAGS+=-DUSE_MINILIBC=1
LDFLAGS = -nostdlib /usr/lib/crt1.o
STATIC=-static
else
CFLAGS+=-DUSE_MINILIBC=0
STATIC=
endif

init: init.o $(MINILIBC)
	gcc $(STATIC) -g $(LDFLAGS) -o init init.o $(MINILIBC)
	strip init

clean:
	rm -f init *.o
