| 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 \ |
| errno.o \ |
| getcwd.o \ |
| getopt.o \ |
| link.o \ |
| malloc.o \ |
| mkdir.o \ |
| qsort.o \ |
| readlink.o \ |
| rmdir.o \ |
| sleep.o \ |
| symlink.o \ |
| unlink.o \ |
| posix-io/access.o \ |
| posix-io/close.o \ |
| posix-io/creat.o \ |
| posix-io/dirent.o \ |
| posix-io/dup.o \ |
| posix-io/fsync.o \ |
| posix-io/isatty.o \ |
| posix-io/lseek.o \ |
| posix-io/open.o \ |
| posix-io/read.o \ |
| posix-io/stat.o \ |
| posix-io/truncate.o \ |
| posix-io/tty-fd.o \ |
| posix-io/write.o \ |
| process/abort.o \ |
| process/exit.o \ |
| process/getpid.o \ |
| stdio/perror.o \ |
| stdio/rename.o \ |
| string/strdup.o \ |
| string/strerror.o \ |
| string/strnlen.o \ |
| string/strtok.o \ |
| time/gettimeofday.o \ |
| time/gmtime.o \ |
| time/localtime.o \ |
| time/mktime.o \ |
| time/settimeofday.o \ |
| time/strftime.o \ |
| time/time.o \ |
| time/tzset.o \ |
| time/utimens.o \ |
| time/utimes.o |
| |
| first: c.dll |
| |
| c.dll: dllcrt.o $(MOD) |
| $(LD) $(LDFLAGS) $^ -o $@ -L. -lntdll -lgcc |
| |
| libc.a: $(MOD) |
| $(AR) -r $@ $^ |
| |
| 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 |