Makefile 1.36 KB
CC=gcc
CPP=g++
MAKE=make
LD=ld

# CFLAGS=-ggdb
CXXFLAGS=

LDFLAGS_X11=-L/usr/X11R6/lib -lX11 -lXext
INC_X11=-I/usr/X11R6/include

# LDFLAGS=$(LDFLAGS_X11) -lefence
LDFLAGS=$(LDFLAGS_X11)
INC=$(INC_X11)

OBJECTS=gra_app.o dispatcher.o event_source.o rasterize.o
XWIN_OBJ=xwin/canvas_x11.o xwin/canvas_x11_shm.o xwin/disp_x11.o xwin/xclass.o
GEOM_OBJ=geometry/vertex.o geometry/polygon.o geometry/polyeder.o
HELPER_OBJ=
MATH_OBJ=math/sin_cos.o
CANVAS_IMP_OBJ=canvas_imps/canvas_imp_rgb.o

OBJ=$(OBJECTS) $(GEOM_OBJ) $(HELPER_OBJ) $(MATH_OBJ) $(XWIN_OBJ) 
OBJ+=$(CANVAS_IMP_OBJ)

%.o: %.cpp
	$(CPP) $(CFLAGS) $(CXXFLAGS) $(INC) -c $*.cpp

.PHONY : all geometry helper math xwin canvas_imps geometry_clean helper_clean math_clean xwin_clean canvas_imps_clean clean

all: engage

engage: geometry helper math xwin canvas_imps $(OBJECTS)
	$(CPP) $(CFLAGS) $(CXXFLAGS) $(INC) $(LDFLAGS) -o $@ $(OBJ)

geometry:
	@cd geometry && $(MAKE)

helper:
	@cd helper && $(MAKE)

math:
	@cd math && $(MAKE)

xwin:
	@cd xwin && $(MAKE)

canvas_imps:
	@cd canvas_imps && $(MAKE)

geometry_clean:
	@cd geometry && $(MAKE) clean

helper_clean:
	@cd helper && $(MAKE) clean

math_clean::
	@cd math && $(MAKE) clean

xwin_clean::
	@cd xwin && $(MAKE) clean

canvas_imps_clean::
	@cd canvas_imps && $(MAKE) clean

clean: geometry_clean helper_clean math_clean xwin_clean canvas_imps_clean
	@rm -f gra_app
	@rm -f *.o