=================================================================== RCS file: /cvs/djgpp/djgpp/src/stub/makefile,v retrieving revision 1.1 retrieving revision 1.2 diff -p -u -r1.1 -r1.2 --- djgpp/src/stub/makefile 1996/01/16 02:10:50 1.1 +++ /cvs/djgpp/djgpp/src/stub/makefile 1998/09/27 17:03:58 1.2 @@ -1,59 +1,84 @@ +# Copyright (C) 1998 DJ Delorie, see COPYING.DJ for details # Copyright (C) 1996 DJ Delorie, see COPYING.DJ for details # Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details -BIN=../../bin -INC=../../include -CFLAGS=-O3 -MD -STUBIFY=../../bin/stubify.exe -C_INCLUDE_PATH := ../../include -LIBRARY_PATH := ../../lib -export -PATH := $(PATH);$(BIN) -all :: \ +TOP = . + +include ../makefile.inc +# djasm.y would be killed by -Werror -Wall, so let's relax a bit: +XGCC = $(XLGCC) + +all :: native \ $(BIN)/djasm.exe \ $(BIN)/go32-v2.exe \ $(BIN)/stubedit.exe \ $(BIN)/stubify.exe \ + $(BIN)/coff2exe.exe \ $(BIN)/exe2coff.exe \ $(INC)/stubinfo.h \ $E -$(BIN)/% : % - cp $< $@ +native :: \ + $(HOSTBIN)/djasm.exe \ + $(HOSTBIN)/stubedit.exe \ + $(HOSTBIN)/stubify.exe \ + $(INC)/stubinfo.h \ + $E + $(NOP) -sbrk16.ah : sbrk16.asm djasm.exe - ../bin/djasm.exe sbrk16.asm sbrk16.ah -stubify.exe : stubify - $(STUBIFY) stubify +sbrk16.ah : sbrk16.asm $(HOSTBIN)/djasm.exe + $(HOSTBIN)/djasm.exe sbrk16.asm sbrk16.ah -exe2coff.exe : exe2coff - $(STUBIFY) exe2coff +$(INC)/stubinfo.h : stub.asm stub.map ./stub2inc.exe + ./stub2inc.exe stub.map stub.asm $(INC)/stubinfo.h -stubify.o : stub.h +stub.h stub.map : stub.asm $(HOSTBIN)/djasm.exe + $(HOSTBIN)/djasm.exe stub.asm stub.h stub.map -$(INC)/stubinfo.h : stub.asm stub.map stub2inc.exe - stub2inc stub.map stub.asm $(INC)/stubinfo.h -stub.h stub.map : stub.asm $(BIN)/djasm.exe - $(BIN)/djasm.exe stub.asm stub.h stub.map +djasm.c: djasm.y + $(CROSS_BISON) -o djasm.c djasm.y -djasm.exe : djasm - $(STUBIFY) djasm +# with a native build, gcc is *using* stubify! +$(BIN)/stubify.exe : stubbify.exe + $(MISC) cp $< $(BIN)/stubify.exe -$(BIN)/go32-v2.exe : go32-v2.c - gcc -s $(CFLAGS) go32-v2.c -o $(BIN)/go32-v2.exe -ldbg +stubbify.exe: $(C) stubify.o $(L) + $(LINK) + $(EXE) -stub2inc.exe : stub2inc - $(STUBIFY) stub2inc +$(BIN)/coff2exe.exe : $(HOSTBIN)/stubify.exe + $< -g $@ + $(HOSTBIN)/stubedit.exe $@ runfile=stubify -stubedit.exe : stubedit $(INC)/stubinfo.h - $(STUBIFY) stubedit +stubify.o: stubify.c stub.h -clean :: - -rm -f *.exe djasm stub.h stub.map stubedit stubify *.o stub2inc *.d +$(BIN)/exe2coff.exe : exe2coff.o + +$(BIN)/go32-v2.exe : $(C) go32-v2.o $(LIB)/libdbg.a $(L) + $(LINK) + $(EXE) + +$(BIN)/stubedit.exe : $(C) stubedit.o $(L) + $(LINK) + $(EXE) -DEPS := $(wildcard *.d) -ifneq ($(DEPS),) -include $(DEPS) -endif + +$(HOSTBIN)/djasm.exe : djasm.y + $(BISON) -o djasm-n.c djasm.y + $(GCC) djasm-n.c -o $@ + $(MISC) rm djasm-n.c + +$(HOSTBIN)/stubify.exe : stubify.c stub.h + $(GCC) stubify.c -o $@ + +$(HOSTBIN)/stubedit.exe : stubedit.c $(INC)/stubinfo.h + $(GCC) stubedit.c -o $@ + +./stub2inc.exe : stub2inc.c + $(GCC) stub2inc.c -o $@ + +clean :: + @-$(MISC) rm djasm.c stub.map stub.h stub2inc.exe stubbify.exe + @-$(MISC) rm $(HOSTBIN)/djasm.exe $(HOSTBIN)/stubedit.exe $(HOSTBIN)/stubify.exe