Adding new config system, template modbus coke, AUTHIDENT in client
[tpg/opendispense2.git] / src / server / Makefile
index 04161e4..300145d 100644 (file)
@@ -1,14 +1,18 @@
 # OpenDispense 2
 #
 
-OBJ := main.o server.o logging.o
+INSTALLDIR := /usr/local/opendispense2
+
+OBJ := main.o server.o logging.o config.o
 OBJ += dispense.o itemdb.o
 OBJ += handler_coke.o handler_snack.o handler_door.o
 BIN := ../../dispsrv
 
-LINKFLAGS := -g ../../cokebank.so -lldap
+DEPFILES := $(OBJ:%.o=%.d)
+
+LINKFLAGS := -g ../../cokebank.so -lutil -lident -lmodbus -Wl,-rpath,. -Wl,-rpath,$(INSTALLDIR)
 CPPFLAGS := 
-CFLAGS := -Wall -g
+CFLAGS := -Wall -Wextra -Werror -g -std=gnu99
 
 .PHONY: all clean
 
@@ -18,5 +22,11 @@ clean:
        $(RM) $(BIN) $(OBJ)
 
 $(BIN): $(OBJ)
-       $(CC) -o $(BIN) $(LINKFLAGS) $(OBJ)
+       $(CC) -o $(BIN) $(OBJ) $(LINKFLAGS)
+
+%.o: %.c
+       $(CC) -c $< -o $@ $(CFLAGS) $(CPPFLAGS)
+       @cpp $< -MM -MF $*.d
+       
+-include $(DEPFILES)
 

UCC git Repository :: git.ucc.asn.au