#=================================================
# Makefile for URG sample programs (scip-samples)
#-------------------------------------------------
# Copyright (C) 2007 aokaze (Hara Yoshitaka)
# bluewind@roboken.esys.tsukuba.ac.jp
#=================================================

# 桼ץॽե
# ʥ桼ץˤϡɲäХѥ뤵롣
SRC     = rmap.c

# 桼ץ४֥ȥե
OBJ     = ${SRC:.c=.o}

# ¹ԥե
TARGET  = ${SRC:.c=}

# إåե
HEAD    = scipBase.h scip1.h scip2.h scipUtil.h

# API ե
API_SRC = scipBase.c scip1.c scip2.c scipUtil.c
API_OBJ = ${API_SRC:.c=.o}

CC      = gcc

INC_DIR = -I/usr/local/include

LIB_DIR = -L/usr/local/lib
LIBS    = -lm -lLxSpur

# Debug build
CFLAGS  = -g -Wall -Wmissing-prototypes $(INC_DIR)

# Release build
#CFLAGS = -O2 -Wall -Werror -Wmissing-prototypes $(INC_DIR)

all: $(TARGET)

# Compile
$(API_OBJ) $(OBJ): $(HEAD)
.c.o:
	$(CC) $(CFLAGS) -c $<

# Link
$(TARGET): $(API_OBJ) $(OBJ)
	$(CC) $(LIB_DIR) $(LIBS) $(API_OBJ) $@.o -o $@

# Clean
clean:
	rm -f $(TARGET) *.o core*

# Install
install:
	install $(TARGET) /usr/local/bin/

# Uninstall
uninstall:
	rm -f /usr/local/bin/$(TARGET)
