beautypg.com

Sample dos make file for microsoft compilers -5, Sample dos make file for microsoft compilers – Rockwell Automation 1747-PCIS API Software - Open Controller User Manual

Page 27

background image

Publication 1747-UM002A-US-P - June 2000

Using the API 2-5

APIINC = .. # Path to Open Controller API include file

#----------------------------------------------
# Options
#----------------------------------------------
CFLAGS = -c -v- -w -ml -I$(APIINC)
LFLAGS = -v- -Tde -d -c

sample.exe : sample.obj $(APILIB) sampleb.mak
$(LINK) $(LFLAGS) c0l sample.obj, $*.exe, $*.map, $(APILIB) cl

clean:
del *.exe
del *.obj
del *.map

rebuild:
$(MAKE) clean
$(MAKE)
.c.obj:
$(CC) $(CFLAGS) $*.c

sample.obj: sample.c $(APIINC)\ocapi.h
sampleb.mak

Sample DOS MAKE file for Microsoft compilers

The following sample file shows how to use a Microsoft MAKE file.
The bold headings indicate the statements you need to modify for
your environment.

#************************************************************************

#

Title: Makefile for Open Controller API Sample

#

# Abstract:
# This file is used by the Microsoft NMake utility to build the
# sample application.

#

# Environment:
# 1747-OCE Open Controller
# MS-DOS
# Microsoft C/C++ Compiler (16-bit)
#************************************************************************

#----------------------------------------------
# Note: The environment variables LIB and
# INCLUDE must be set to the path to the
# Microsoft C library and include files.
# For example:

#

# set LIB=D:\MSVC15\LIB
# set INCLUDE=D:\MSVC15\INCLUDE

#

#----------------------------------------------
# Paths to Tools

#

# Note: Modify the following paths to
# correspond to your environment.

#

#----------------------------------------------
CPATH = D:\MSVC15 # Location of Microsoft tools
CC = $(CPATH)\bin\cl # compiler
LINK = $(CPATH)\bin\link # linker
MAKE = $(CPATH)\bin\nmake # make utility

#----------------------------------------------
# Path to API Library and Include file

This manual is related to the following products: