| 1 | # $Id: makefile.gcc,v 1.8 2000-12-02 23:26:58 bird Exp $
|
|---|
| 2 |
|
|---|
| 3 | #
|
|---|
| 4 | # Odin32 API
|
|---|
| 5 | #
|
|---|
| 6 | # Tools common library, GCC version.
|
|---|
| 7 | #
|
|---|
| 8 | #
|
|---|
| 9 |
|
|---|
| 10 |
|
|---|
| 11 | #
|
|---|
| 12 | # If OMF flag isn't set, set it to default value.
|
|---|
| 13 | #
|
|---|
| 14 | !ifndef OMF
|
|---|
| 15 | OMF=0
|
|---|
| 16 | !endif
|
|---|
| 17 |
|
|---|
| 18 |
|
|---|
| 19 | #
|
|---|
| 20 | # Directories and common tools.
|
|---|
| 21 | #
|
|---|
| 22 | ODIN32_INCLUDE = ..\..\include
|
|---|
| 23 | ODIN32_BIN = ..\..\bin\$(OBJDIR)
|
|---|
| 24 | ODIN32_LIB = ..\..\lib
|
|---|
| 25 | ODIN32_TOOLS = ..\bin
|
|---|
| 26 | ODIN32_TCOMMON = ..\common
|
|---|
| 27 | !include $(ODIN32_INCLUDE)\odin32.tools
|
|---|
| 28 |
|
|---|
| 29 | # Definitions for odin32.post
|
|---|
| 30 | LOCALCLEAN = 1
|
|---|
| 31 | CLEANEXTRAS = commongcc.*
|
|---|
| 32 | OLD_STYLE = 1
|
|---|
| 33 |
|
|---|
| 34 |
|
|---|
| 35 | #
|
|---|
| 36 | # gcc defines
|
|---|
| 37 | #
|
|---|
| 38 | CC = gcc
|
|---|
| 39 | CXX = gcc
|
|---|
| 40 | LD = gcc
|
|---|
| 41 | !ifdef DEBUG
|
|---|
| 42 | OBJDIR = .\bin\debug
|
|---|
| 43 | !else
|
|---|
| 44 | OBJDIR = .\bin\release
|
|---|
| 45 | !endif
|
|---|
| 46 |
|
|---|
| 47 |
|
|---|
| 48 | !if $(OMF) == 0
|
|---|
| 49 | # aout version
|
|---|
| 50 | O = o
|
|---|
| 51 | LIB = a
|
|---|
| 52 | AR = ar
|
|---|
| 53 | CFZOMF =
|
|---|
| 54 |
|
|---|
| 55 | !else
|
|---|
| 56 | # OMF version
|
|---|
| 57 | O = gobj
|
|---|
| 58 | LIB = lib
|
|---|
| 59 | AR = emxomfar
|
|---|
| 60 | CFZOMF = -Zomf
|
|---|
| 61 |
|
|---|
| 62 | !endif
|
|---|
| 63 |
|
|---|
| 64 |
|
|---|
| 65 | CDEFINES = -D__WIN32OS2__ -D__WINE__
|
|---|
| 66 | CINCLUDES = -I$(ODIN32_INCLUDE)\Win -I$(ODIN32_INCLUDE)
|
|---|
| 67 | CPLUS_INCLUDE_PATH= $(CPLUS_INCLUDE_PATH);$(INCLUDE)
|
|---|
| 68 |
|
|---|
| 69 | # Note: Add -fhandle-exceptions if old gcc version (< 2.8.x?).
|
|---|
| 70 | !ifndef DEBUG
|
|---|
| 71 | CFLAGS = $(CFZOMF) -Wall -Zmap -Zmt -mprobe -Wall -s -O
|
|---|
| 72 | !else
|
|---|
| 73 | CFLAGS = $(CFZOMF) -Wall -Zmap -Zmt -mprobe -Wall -g
|
|---|
| 74 | !endif
|
|---|
| 75 | CXXFLAGS = $(CFLAGS)
|
|---|
| 76 |
|
|---|
| 77 |
|
|---|
| 78 | #
|
|---|
| 79 | # Interference rules
|
|---|
| 80 | #
|
|---|
| 81 | .c{$(OBJDIR)}.$(O):
|
|---|
| 82 | $(CC) -c $(CFLAGS) $(CDEFINES) $(CINCLUDES) $< -o $@
|
|---|
| 83 |
|
|---|
| 84 | .cpp{$(OBJDIR)}.$(O):
|
|---|
| 85 | $(CXX) -c $(CXXFLAGS) $(CDEFINES) $(CINCLUDES) $< -o $@
|
|---|
| 86 |
|
|---|
| 87 |
|
|---|
| 88 | #
|
|---|
| 89 | # Object files.
|
|---|
| 90 | #
|
|---|
| 91 | OBJS = \
|
|---|
| 92 | $(OBJDIR)\kFilePe.$(O) \
|
|---|
| 93 | $(OBJDIR)\kFileDef.$(O) \
|
|---|
| 94 | $(OBJDIR)\kFileLx.$(O) \
|
|---|
| 95 | $(OBJDIR)\kFileFormatBase.$(O)\
|
|---|
| 96 | $(OBJDIR)\kFile.$(O)
|
|---|
| 97 |
|
|---|
| 98 |
|
|---|
| 99 | #
|
|---|
| 100 | # All rule.
|
|---|
| 101 | #
|
|---|
| 102 | all: $(OBJDIR) \
|
|---|
| 103 | commongcc.$(LIB)
|
|---|
| 104 |
|
|---|
| 105 |
|
|---|
| 106 | $(OBJDIR)\commongcc.$(LIB): $(OBJS)
|
|---|
| 107 | $(RM) $@
|
|---|
| 108 | $(AR) cr $@ $(OBJS)
|
|---|
| 109 |
|
|---|
| 110 | commongcc.$(LIB): $(OBJDIR)\commongcc.$(LIB)
|
|---|
| 111 | $(CP) $** $@
|
|---|
| 112 |
|
|---|
| 113 |
|
|---|
| 114 | #
|
|---|
| 115 | # dependent rule. forward to main makefile.
|
|---|
| 116 | #
|
|---|
| 117 | dep:
|
|---|
| 118 | @$(MAKE) /nologo -f makefile NODEP=1 dep
|
|---|
| 119 |
|
|---|
| 120 |
|
|---|
| 121 | # Includes the common rules.
|
|---|
| 122 | !error "this makefile doesn't work right now."
|
|---|
| 123 | !include $(ODIN32_INCLUDE)/odin32.post
|
|---|
| 124 |
|
|---|