# Makefile for compile Windows NT native program from mingw-gcc | |
CC = i586-mingw32msvc-gcc | |
LD = i586-mingw32msvc-ld | |
CFLAGS += -I$(NATIVETOOLSDIR)nativelibc/include -I$(NATIVETOOLSDIR)ntdll/include | |
LDFLAGS += -e _NtProcessStartup -L$(NATIVETOOLSDIR)nativelibc | |
LIBS = -lc -lntdll -lgcc | |
LINK.o = $(LD) $(LDFLAGS) $(TARGET_ARCH) | |
%.exe: $(NATIVETOOLSDIR)crtn.o %.o | |
$(LD) $(LDFLAGS) $^ -o $@ $(LIBS) | |
%: $(NATIVETOOLSDIR)crtn.o %.o | |
$(LINK.o) $^ -o $@ $(LIBS) | |
%.o: %.c | |
$(COMPILE.c) $(OUTPUT_OPTION) $< | |
.SUFFIXES: |