blob: a56e26b928e31748b31bb5509c12e131bd8355fb [file] [log] [blame] [raw]
AR = i586-mingw32msvc-ar
CC = i586-mingw32msvc-gcc
LD = i586-mingw32msvc-ld
CFLAGS += -Iinclude -I../ntdll/include -O1 -Wall
LDFLAGS += --shared -e _DllMainCRTStartup --enable-stdcall-fixup --subsystem 1
MOD = \
assert.o \
char-io.o \
getcwd.o \
link.o \
malloc.o \
mkdir.o \
sleep.o \
symlink.o \
unlink.o \
posix-io/close.o \
posix-io/creat.o \
posix-io/dup.o \
posix-io/lseek.o \
posix-io/open.o \
posix-io/read.o \
posix-io/tty-fd.o \
posix-io/write.o \
process/abort.o \
process/exit.o \
process/getpid.o \
string/strdup.o \
string/strnlen.o
first: c.dll
libc.a: $(MOD)
$(AR) r $@ $(MOD)
c.dll: dllcrt.o $(MOD)
$(LD) $(LDFLAGS) $^ -o $@ -L. -lntdll -lgcc
dllcrt.o: build-version.h
build-version.h:
@{ [ -d ../.git ] && { export LANG=C; version=`git log --no-color --first-parent -n1 --pretty=format:%h`; echo "#define PKGVERSION \"$$version\""; } || echo "#define PKGVERSION \"Separate Build\""; } > $@
@echo "#define BUILD_DATE \"`date -u +%F\ %T` UTC\"" >> $@
clean:
rm -f build-version.h dllcrt.o $(MOD) libc.a c.dll