1# 2# GNUmakefile -- 3# 4# GNU Makefile for w32 VC++ environment. 5# 6# Copyright (c) 2000-2005 Yigal Hochberg, DMH Software. 7# Copyright (c) 2000 E. Schoenfelder, Gaertner Datensysteme Braunschweig. 8# Copyright (c) 2000 J. Schoenwaelder, Technical University of Braunschweig. 9# 10# See the file "COPYING" for information on usage and redistribution 11# of this file, and for a DISCLAIMER OF ALL WARRANTIES. 12# 13# @(#) $Id: GNUmakefile 2409 2005-05-30 13:14:21Z strauss $ 14 15## 16## Project directories -- these may need to be customized for your site 17## 18## ROOT -- top of the source tree. 19## TMPDIR -- location for .obj files. 20## TOOLS32 -- location of VC++ compiler installation. 21## 22ROOT = ./.. 23TMPDIR = . 24TOOLS32 = C:\PROGRA~1\MICROS~2\VC98 25 26## 27## Installation paths: 28## 29## MIBROOT -- definition for default search path (unix-style) 30## MIBDIR -- same in windows style 31## BINDIR -- destination for the binaries (smidump.exe, ...) 32## LIBDIR -- destination for the library (smi.lib) 33## 34MIBROOT = c:/smi/mibs 35INSTROOT = c:\smi 36MIBDIR = $(INSTROOT)\mibs 37BINDIR = $(INSTROOT)\bin 38LIBDIR = $(INSTROOT)\lib 39 40## 41## This include is for smidump_SOURCES definition. 42## 43include ../tools/Makefile.am 44 45## 46## Visual C++ tools 47## 48PATH := $(TOOLS32)\bin;$(PATH) 49 50cc32 = cl 51implib = lib 52CC = $(cc32) 53CFLAGS = -nologo -W3 -DYY_NO_UNISTD_H 54CC_INCL = #-I$(TOOLS32)/include 55AR = $(implib) 56ARFLAGS = -nologo 57CP = copy 58RM = del 59MKDIR = md 60 61## 62## Definitions: 63## 64#DEBUG = -W3 -Zi -Od /Yd 65INCLUDES = -I$(ROOT)/lib -I$(ROOT)/win $(CC_INCL) 66DEFINES = $(DEBUG) 67 68## 69## Library objects 70## 71LIBSMIOBJS = $(patsubst %.c, %.obj, $(notdir $(wildcard ../lib/*.c))) win.obj \ 72 shhopt.obj 73 74## 75## Tool objects 76## 77SMIQUERYOBJS = smiquery.obj 78SMILINTOBJS = smilint.obj 79SMIDUMPOBJS = $(filter-out %.h, $(smidump_SOURCES:.c=.obj)) 80 81## 82## Targets 83## 84all: libs tools 85 86libs: smi.lib 87tools: smiquery.exe smilint.exe smidump.exe 88 89smi.lib: $(LIBSMIOBJS) 90smiquery.exe: $(SMIQUERYOBJS) smi.lib 91smilint.exe: $(SMILINTOBJS) smi.lib 92smidump.exe: $(SMIDUMPOBJS) smi.lib 93 94clean: 95 del *.lib 96 del *.obj 97 del *.exe 98 del *.ilk 99 del *.pdb 100 del *.mdp 101 102install: all install-doc install-bin install-lib install-mibs 103 104install-doc: 105 $(MKDIR) $(INSTROOT) 106 $(CP) ..\README $(INSTROOT) 107 $(CP) ..\COPYING $(INSTROOT) 108 $(CP) README.win $(INSTROOT) 109 $(MKDIR) $(INSTROOT)\doc 110 $(CP) ..\doc\*.txt $(INSTROOT)\doc 111 $(CP) ..\doc\*.ps $(INSTROOT)\doc 112 113install-bin: 114 $(MKDIR) $(BINDIR) 115 $(CP) *.exe $(BINDIR) 116 117install-lib: 118 $(MKDIR) $(LIBDIR) 119 $(CP) *.lib $(LIBDIR) 120 121install-mibs: 122 $(MKDIR) $(MIBDIR) 123 $(MKDIR) $(MIBDIR)\iana 124 $(CP) ..\mibs\iana\*.* $(MIBDIR)\iana 125 $(MKDIR) $(MIBDIR)\ietf 126 $(CP) ..\mibs\ietf\*.* $(MIBDIR)\ietf 127 $(MKDIR) $(MIBDIR)\irtf 128 $(CP) ..\mibs\irtf\*.* $(MIBDIR)\irtf 129 $(MKDIR) $(MIBDIR)\tubs 130 $(CP) ..\mibs\tubs\*.* $(MIBDIR)\tubs 131 $(MKDIR) $(MIBDIR)\site 132 133## 134## Generic rules 135## 136vpath %.c ../lib 137vpath %.c ../tools 138 139%.obj : %.c 140 $(CC) $(CFLAGS) -c $(INCLUDES) $(DEFINES) -Fo$@ $< 141 142%.exe : 143 $(CC) $(CFLAGS) $(DEFINES) -o $(notdir $@) $^ 144 145%.lib : 146 $(AR) $(ARFLAGS) -out:$(notdir $@) $^ 147 148## 149## Special compilation rules for scanner files 150## 151scanner-objs = scanner-smi.obj scanner-sming.obj 152 153$(scanner-objs) : %.obj : %.c 154 $(CC) -c $(CFLAGS) -D__STDC__ $(INCLUDES) $(DEFINES) -Fo$@ $< 155 156