| 1 | # $Id: pdwin32.wat.post,v 1.2 2000-09-21 11:17:28 bird Exp $
 | 
|---|
| 2 | #
 | 
|---|
| 3 | # Odin32 API
 | 
|---|
| 4 | #
 | 
|---|
| 5 | # Common dll makefile rules (must be included at the last line of the makefile)
 | 
|---|
| 6 | #
 | 
|---|
| 7 | # If ORGTARGET is defined it is used to generate the importlibrary.
 | 
|---|
| 8 | #
 | 
|---|
| 9 | # Define NOTEXPDEF to remove the $(TARGET).lib and $(TARGET)exp.def rules.
 | 
|---|
| 10 | # Define EXETARGET to make an executable. (This also applies to pdwin32.mk.)
 | 
|---|
| 11 | # Define LOCALCLEAN if only the local directory is to be clean.
 | 
|---|
| 12 | # Define CLEAN2 to invoke a second clean rule named 'clean2'.
 | 
|---|
| 13 | # Define NOCLEAN to exclude the clean rule. (Remember to make your own!)
 | 
|---|
| 14 | #
 | 
|---|
| 15 | 
 | 
|---|
| 16 | 
 | 
|---|
| 17 | # Copy library rule.
 | 
|---|
| 18 | !ifndef ORGTARGET
 | 
|---|
| 19 | $(PDWIN32_LIB)\$(TARGET).lib: $(TARGET).lib
 | 
|---|
| 20 | !else
 | 
|---|
| 21 | $(PDWIN32_LIB)\$(ORGTARGET).lib: $(ORGTARGET).lib
 | 
|---|
| 22 | !endif
 | 
|---|
| 23 |     $(CP) $** $@
 | 
|---|
| 24 | 
 | 
|---|
| 25 | 
 | 
|---|
| 26 | # Copy dll rule.
 | 
|---|
| 27 | !ifndef EXETARGET
 | 
|---|
| 28 | $(PDWIN32_BIN)\$(TARGET).dll: $(OBJDIR)\$(TARGET).dll
 | 
|---|
| 29 | !else
 | 
|---|
| 30 | $(PDWIN32_BIN)\$(TARGET).exe: $(OBJDIR)\$(TARGET).exe
 | 
|---|
| 31 | !endif
 | 
|---|
| 32 |     cd $(OBJDIR)
 | 
|---|
| 33 |     $(MAPSYM) $(TARGET).map
 | 
|---|
| 34 |     cd ..\..
 | 
|---|
| 35 |     $(CP) $(OBJDIR)\$(TARGET).sym $(PDWIN32_BIN)
 | 
|---|
| 36 |     $(CP) $** $@
 | 
|---|
| 37 |     $(CP) $** $(@D)..\..\$(@F)
 | 
|---|
| 38 |     $(CP) $(OBJDIR)\$(TARGET).sym $(@D)..\..
 | 
|---|
| 39 | 
 | 
|---|
| 40 | 
 | 
|---|
| 41 | !ifndef NOTEXPDEF
 | 
|---|
| 42 | # make library from the <>exp.def file.
 | 
|---|
| 43 | !ifndef ORGTARGET
 | 
|---|
| 44 | $(TARGET).LIB: $(TARGET)exp.def
 | 
|---|
| 45 | !else
 | 
|---|
| 46 | $(ORGTARGET).LIB: $(ORGTARGET)exp.def
 | 
|---|
| 47 | !endif
 | 
|---|
| 48 |     $(IMPLIB) $(IMPLIBFLAGS) $@ $**
 | 
|---|
| 49 |     $(CP) $@ $(PDWIN32_LIB)
 | 
|---|
| 50 | 
 | 
|---|
| 51 | 
 | 
|---|
| 52 | # make the <>exp.def file.
 | 
|---|
| 53 | !ifndef ORGTARGET
 | 
|---|
| 54 | $(TARGET)exp.def: $(TARGET).def
 | 
|---|
| 55 | !else
 | 
|---|
| 56 | $(ORGTARGET)exp.def: $(ORGTARGET).def
 | 
|---|
| 57 | !endif
 | 
|---|
| 58 |     $(IMPDEF) $** $@
 | 
|---|
| 59 | !endif
 | 
|---|
| 60 | 
 | 
|---|
| 61 | 
 | 
|---|
| 62 | # Create the object directory.
 | 
|---|
| 63 | $(OBJDIR): .SYMBOLIC
 | 
|---|
| 64 |     @if not exist bin $(MKDIR) bin
 | 
|---|
| 65 |     @if not exist $(OBJDIR) $(MKDIR) $(OBJDIR)
 | 
|---|
| 66 | 
 | 
|---|
| 67 | 
 | 
|---|
| 68 | #
 | 
|---|
| 69 | # General clean rule. To clean more add it to CLEANEXTRAS!
 | 
|---|
| 70 | #
 | 
|---|
| 71 | !ifndef NOCLEAN
 | 
|---|
| 72 | !ifndef CLEAN2
 | 
|---|
| 73 | clean: .SYMBOLIC
 | 
|---|
| 74 | !else
 | 
|---|
| 75 | clean:  clean2
 | 
|---|
| 76 | !endif
 | 
|---|
| 77 |     $(RM) *.LIB *.res *.map *.pch \
 | 
|---|
| 78 | !if "$(OBJDIR)" != ""
 | 
|---|
| 79 |      $(OBJDIR)\* \
 | 
|---|
| 80 | !endif
 | 
|---|
| 81 | !ifndef LOCALCLEAN
 | 
|---|
| 82 |         $(PDWIN32_LIB)\$(TARGET).LIB \
 | 
|---|
| 83 | !ifndef EXETARGET
 | 
|---|
| 84 |         $(PDWIN32_BIN)\$(TARGET).dll $(TARGET)exp.def *.dll \
 | 
|---|
| 85 | !else
 | 
|---|
| 86 |         $(PDWIN32_BIN)\$(TARGET).exe *.exe \
 | 
|---|
| 87 | !endif
 | 
|---|
| 88 |         $(CLEANEXTRAS)
 | 
|---|
| 89 | !else
 | 
|---|
| 90 |         $(CLEANEXTRAS)
 | 
|---|
| 91 | !endif
 | 
|---|
| 92 | !endif
 | 
|---|
| 93 | 
 | 
|---|
| 94 | 
 | 
|---|