Get the Play/Pause and Quit buttons working nicely
[cs356-p1-elevator.git] / Makefile
index 116c3ce..d24a57c 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,12 +1,21 @@
-test: position.o stop.o elevator.o elevatorcontroller.o test.o
-       g++ -o $@ $^
+CC=g++
+CFLAGS=`pkg-config gtkmm-2.4 --cflags`
+LIBS=`pkg-config gtkmm-2.4 --libs`
 
-run: test
-       ./test
+SRCS=position.cpp stop.cpp elevator.cpp elevatorcontroller.cpp elevatordoor.cpp callbutton.cpp positionlabel.cpp requestbutton.cpp elevatorgui.cpp main.cpp
+
+main: $(SRCS:.cpp=.o)
+       $(CC) -o $@ $^ $(LIBS)
+
+.cpp.o:
+       $(CC) $(CFLAGS) -c -o $@ $<
+
+run: main
+       ./main
 
 clean:
-       rm -f *.o test
+       rm -f *.o main
 
-all: test
+all: main
 
 .PHONY: run clean all