Sample dos make file for microsoft compilers -6, Sample dos make file for microsoft compilers – Rockwell Automation 1747-PCINT API Software for 1746 I/O User Manual

Page 22

Advertising
background image

2–6

Using the API

Publication 1747-6.5.3 June 1998

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
#
# Note: Modify the following path to
# correspond to your environment.
#
#----------------------------------------------
APILIB = ..ocapil.lib # Path to Open Controller API library
APIINC = .. # Path to Open Controller API include file

#----------------------------------------------
# Options
#----------------------------------------------
CFLAGS = /c /nologo /G3 /W3 /AL /Oi /D /Gx- /I $(APIINC)
LFLAGS = /MAP:A /NOI /PACKC

sample.exe : sample.obj $(APILIB) samplem.mak
$(LINK) $(LFLAGS) sample.obj, $*.exe, $*.map, $(APILIB), nul.def

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

rebuild:
$(MAKE) -f samplem.mak clean
$(MAKE) -f samplem.mak

.c.obj:
$(CC) $(CFLAGS) $*.c

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

Advertising
This manual is related to the following products: