home *** CD-ROM | disk | FTP | other *** search
/ PC Extra Super CD 1998 January / PCPLUS131.iso / DJGPP / V2 / DJLSR201.ZIP / src / makefile.inc < prev    next >
Encoding:
Makefile  |  1996-09-01  |  1.1 KB  |  61 lines

  1.  
  2. .SUFFIXES: .o .i .c .cc .s
  3.  
  4. GCC = gcc @$(TOP)/../gcc.opt -I. -I- -I$(TOP)/../../include $(CFLAGS) -c $<
  5.  
  6. %.o : %.c
  7.     $(GCC)
  8. %.o : %.cc
  9.     $(GCC)
  10. %.o : %.S
  11.     $(GCC)
  12.  
  13. %.i : %.c
  14.     $(GCC) -E > $@
  15. %.i : %.cc
  16.     $(GCC) -E > $@
  17. %.i : %.S
  18.     $(GCC) -E > $@
  19.  
  20. %.ss : %.c
  21.     $(GCC) -S > $@
  22. %.ss : %.cc
  23.     $(GCC) -S > $@
  24.  
  25. LINK = ld $(LDFLAGS) $(filter %.o,$^) $(filter-out %.o,$^) -o $@ ${LIB}/libgcc.a -T ${TOP}/../../lib/djgpp.djl
  26. EXE = ${TOP}/../../bin/stubify.exe $@
  27.  
  28. LIB=$(TOP)/../../lib
  29. BIN=$(TOP)/../../bin
  30. INC=$(TOP)/../../include
  31. INFO=$(TOP)/../../info
  32.  
  33. C = $(LIB)/crt0.o
  34. L = $(LIB)/libc.a
  35.  
  36. OBJS := $(addsuffix .o, $(basename $(SRC)))
  37. EXES := $(addprefix $(BIN)/,$(addsuffix .exe, $(basename $(SRC))))
  38.  
  39. .PRECIOUS: %.exe %.out %.err
  40.  
  41. $(INFO)/%.inf : %.tex
  42.     makeinfo --no-split $<
  43.  
  44. $(BIN)/%.exe : $C %.o $L
  45.     $(LINK)
  46.     $(EXE)
  47.  
  48. all :: $(OBJS) $(EXTRA_OBJS) makefile.oh
  49.     @rem.com
  50.  
  51. makefile.oh : makefile
  52.     @echo.exe -o makefile.oh $(addprefix &/,$(OBJS))
  53.  
  54. clean ::
  55.     -rm -f *.o *.d *.i makefile.oh
  56.  
  57. DEPS := $(wildcard *.d)
  58. ifneq ($(DEPS),)
  59. include $(DEPS)
  60. endif
  61.