# makefile used for building a windows binary on a linux system # using ubuntu mingw package # #--------------------------------------------------------------------------------- .SUFFIXES: #--------------------------------------------------------------------------------- #--------------------------------------------------------------------------------- # the prefix on the compiler executables #--------------------------------------------------------------------------------- PREFIX := /usr/bin/i586-mingw32msvc- export CC := $(PREFIX)gcc export CXX := $(PREFIX)g++ export AS := $(PREFIX)as export AR := $(PREFIX)ar export OBJCOPY := $(PREFIX)objcopy export BIN2S := bin2s export STRIP := $(PREFIX)strip #--------------------------------------------------------------------------------- %.a: @echo $(notdir $@) @rm -f $@ @$(AR) -rc $@ $^ #--------------------------------------------------------------------------------- %.o: %.cpp @echo $(notdir $<) @$(CXX) -MMD -MP -MF $(DEPSDIR)/$*.d $(CXXFLAGS) -c $< -o $@ #--------------------------------------------------------------------------------- %.o: %.c @echo $(notdir $<) @$(CC) -MMD -MP -MF $(DEPSDIR)/$*.d $(CFLAGS) -c $< -o $@ #--------------------------------------------------------------------------------- %.o: %.s @echo $(notdir $<) @$(CC) -MMD -MP -MF $(DEPSDIR)/$*.d -x assembler-with-cpp $(ASFLAGS) -c $< -o $@ #--------------------------------------------------------------------------------- %.o: %.S @echo $(notdir $<) @$(CC) -MMD -MP -MF $(DEPSDIR)/$*.d -x assembler-with-cpp $(ASFLAGS) -c $< -o $@ #--------------------------------------------------------------------------------- %.bin.o : %.bin @echo $(notdir $<) @$(BIN2S) -a 32 $< | sed 's/$(shell echo $(" $(notdir $@) @$(STRIP) -s $@.debug -o $@ -include $(DEPSDIR)/*.d #--------------------------------------------------------------------------------------- endif #---------------------------------------------------------------------------------------