| 1 |
#------------------------------------------------------------------------------ |
| 2 |
# Copyright (c) 2016, 2022, Oracle and/or its affiliates. |
| 3 |
# |
| 4 |
# This software is dual-licensed to you under the Universal Permissive License |
| 5 |
# (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl and Apache License |
| 6 |
# 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose |
| 7 |
# either license. |
| 8 |
# |
| 9 |
# If you elect to accept the software under the Apache License, Version 2.0, |
| 10 |
# the following applies: |
| 11 |
# |
| 12 |
# Licensed under the Apache License, Version 2.0 (the "License"); |
| 13 |
# you may not use this file except in compliance with the License. |
| 14 |
# You may obtain a copy of the License at |
| 15 |
# |
| 16 |
# https://www.apache.org/licenses/LICENSE-2.0 |
| 17 |
# |
| 18 |
# Unless required by applicable law or agreed to in writing, software |
| 19 |
# distributed under the License is distributed on an "AS IS" BASIS, |
| 20 |
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 21 |
# See the License for the specific language governing permissions and |
| 22 |
# limitations under the License. |
| 23 |
# |
| 24 |
#------------------------------------------------------------------------------ |
| 25 |
# |
| 26 |
# Sample Makefile if you wish to build the ODPI-C sample executables. |
| 27 |
# |
| 28 |
# Look at README.md for information on how to build and run the samples. |
| 29 |
#------------------------------------------------------------------------------ |
| 30 |
|
| 31 |
BUILD_DIR = build |
| 32 |
INCLUDE_DIR = ../include |
| 33 |
LIB_DIR = ../lib |
| 34 |
|
| 35 |
CC=gcc |
| 36 |
LD=gcc |
| 37 |
CFLAGS=-I$(INCLUDE_DIR) -O2 -g -Wall |
| 38 |
LIBS=-L$(LIB_DIR) -lodpic |
| 39 |
COMMON_OBJS = $(BUILD_DIR)/SampleLib.o |
| 40 |
|
| 41 |
SOURCES = DemoBLOB.c DemoCLOB.c DemoFetch.c DemoInsert.c DemoInsertAsArray.c \ |
| 42 |
DemoCallProc.c DemoRefCursors.c DemoImplicitResults.c \ |
| 43 |
DemoFetchObjects.c DemoBindObjects.c DemoFetchDates.c \ |
| 44 |
DemoBindArrays.c DemoBFILE.c DemoAppContext.c DemoDistribTrans.c \ |
| 45 |
DemoObjectAQ.c DemoRawAQ.c DemoBulkAQ.c DemoCQN.c DemoLongs.c \ |
| 46 |
DemoLongRaws.c DemoDMLReturning.c DemoInOutTempLobs.c \ |
| 47 |
DemoConvertNumbers.c DemoCreateSodaColl.c DemoIterSodaColls.c \ |
| 48 |
DemoDropSodaColl.c DemoInsertSodaColl.c DemoGetSodaDoc.c \ |
| 49 |
DemoRemoveSodaDoc.c DemoReplaceSodaDoc.c DemoGetAllSodaDocs.c \ |
| 50 |
DemoGetSodaCollNames.c DemoCLOBsAsStrings.c DemoBLOBsAsBytes.c \ |
| 51 |
DemoInsertManySodaColl.c DemoShardingNumberKey.c DemoFetchJSON.c \ |
| 52 |
DemoBindJSON.c DemoTokenStandalone.c DemoTokenPoolWithCallback.c |
| 53 |
BINARIES = $(SOURCES:%.c=$(BUILD_DIR)/%) |
| 54 |
|
| 55 |
all: $(BUILD_DIR) $(BINARIES) |
| 56 |
|
| 57 |
clean: |
| 58 |
rm -rf $(BUILD_DIR) |
| 59 |
|
| 60 |
$(BUILD_DIR): |
| 61 |
mkdir -p $@ |
| 62 |
|
| 63 |
$(BUILD_DIR)/%.o: %.c SampleLib.h |
| 64 |
$(CC) -c $(CFLAGS) -o $@ $< |
| 65 |
|
| 66 |
$(BUILD_DIR)/%: $(BUILD_DIR)/%.o $(COMMON_OBJS) |
| 67 |
$(LD) $(LDFLAGS) $< -o $@ $(COMMON_OBJS) $(LIBS) |