2014-05-10 21:51:45 +00:00
|
|
|
include ../common.mk
|
2014-05-09 13:24:46 +00:00
|
|
|
|
|
|
|
TARGET = drow-engine
|
2014-05-10 17:33:54 +00:00
|
|
|
HEADERS = err.h common.h print.h filereader.h gl_draw.h vector.h half_edge.h
|
2014-05-10 20:40:59 +00:00
|
|
|
OBJECTS = print.o filereader.o gl_draw.o vector.o half_edge.o
|
2014-05-09 13:24:46 +00:00
|
|
|
INCS = -I.
|
|
|
|
|
|
|
|
CFLAGS += $(shell $(PKG_CONFIG) --cflags gl glu glib-2.0)
|
|
|
|
LIBS = $(shell $(PKG_CONFIG) --libs gl glu glib-2.0) -lglut -lm
|
|
|
|
CPPFLAGS += -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED -D_GNU_SOURCE
|
|
|
|
|
|
|
|
%.o: %.c
|
|
|
|
$(CC) $(CFLAGS) $(CPPFLAGS) $(INCS) -c $*.c
|
|
|
|
|
|
|
|
all: $(TARGET)
|
|
|
|
|
2014-05-10 20:40:59 +00:00
|
|
|
drow-engine.a: $(OBJECTS)
|
|
|
|
$(AR) rcu $@ $^
|
|
|
|
|
|
|
|
test: drow-engine.a
|
|
|
|
$(MAKE) -C test
|
|
|
|
|
|
|
|
$(TARGET): $(HEADERS) drow-engine.a main.o
|
|
|
|
$(CC) $(CFLAGS) $(CPPFLAGS) $(INCS) \
|
|
|
|
-o ../$(TARGET) \
|
|
|
|
main.o drow-engine.a $(LDFLAGS) $(LIBS)
|
2014-05-09 13:24:46 +00:00
|
|
|
|
|
|
|
install: $(TARGET)
|
|
|
|
$(INSTALL_DIR) "$(DESTDIR)$(INSTALL_BINDIR)"
|
|
|
|
$(INSTALL_BIN) $(TARGET) "$(DESTDIR)$(INSTALL_BINDIR)"
|
|
|
|
|
|
|
|
uninstall:
|
|
|
|
rm "$(DESTDIR)$(INSTALL_BINDIR)/$(TARGET)"
|
|
|
|
|
|
|
|
clean:
|
2014-05-10 20:40:59 +00:00
|
|
|
$(MAKE) -C test clean
|
|
|
|
rm -f *.o drow-engine.a $(TARGET) core vgcore*
|
2014-05-09 13:24:46 +00:00
|
|
|
|
|
|
|
|
2014-05-10 20:40:59 +00:00
|
|
|
.PHONY: all clean install test uninstall
|