# MAKE FILE OF CS348C PROGRAMMING ASSIGNMENT 1: PARAMETRIC POLYNOMIAL CURVES.
#
# Copyright (c) 1995 The Board of Trustees of The Leland Stanford Junior
# University. All rights reserved.
# 
# Permission to use, copy, modify and distribute this software for any
# purpose is hereby granted without fee, provided that the above
# copyright notice and this permission notice appear in all copies of
# this software and that you do not sell the software.  Commercial
# licensing is available by contacting the author.
# 
# THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND,
# EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
# WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
# 
# Author:
#    Apostolos Lerios
#    Computer Science Department
#    Stanford University
#    U.S.A.
#    http://graphics.stanford.edu/~tolis/


# CONSTANT DEFINITIONS.

# C++ Compiler flags:
#
#  +p: Disallow anachronisms.
#  -Wf,-XNp20000: Set dimension table size (CC requirement).
#  -DFUNCPROTO: Symbol needed by X for proper function prototypes.
#
#  -g: Include debugging information.
#          OR
#  -O2: Optimize.

CP_FLAGS=+p -Wf,-XNp20000 -DFUNCPROTO -g

# C Compiler flags:
#
#  -g: Include debugging information.
#          OR
#  -O2: Optimize.

C_FLAGS=-g

# Linker flags:
#
#  -s: Remove debugging information.

L_FLAGS=

# Directories for targets and dependents.

OBJ=.
TARGET=.

# Shorthands for compiler invocation.

CP_COMPILE=CC $(CP_FLAGS) -c -o $@
C_COMPILE=cc $(C_FLAGS) -c -o $@

# Shorthands for linker invocation.

LINKER=CC $(CP_FLAGS)
LIBS=-lInventorXt -lXm -lXt -lX11 -lInventor -lXirisw -lgl -lm
LINK=$(LINKER) $(L_FLAGS) -o $@


# LINKING.

OBJS=$(OBJ)/polly.o $(OBJ)/draw.o $(OBJ)/xsupport.o

$(TARGET)/polly: $(OBJS) $(MAKEFILE)
	$(LINK) $(OBJS) $(LIBS)


# COMPILATION.

$(OBJ)/draw.o: draw.c polly.h $(MAKEFILE)
	$(C_COMPILE) draw.c

$(OBJ)/polly.o: polly.c++ polly.h xsupport.h $(MAKEFILE)
	$(CP_COMPILE) polly.c++

$(OBJ)/xsupport.o: xsupport.c++ xsupport.h $(MAKEFILE)
	$(CP_COMPILE) xsupport.c++


# CLEANUP.

clean:
	rm -f $(TARGET)/polly $(OBJS)
