diff --git a/examples/Makefile b/examples/Makefile index 42cc4df..c95011b 100644 --- a/examples/Makefile +++ b/examples/Makefile @@ -1,6 +1,14 @@ +UNAME := $(shell uname) CFLAGS += -I../sml/include/ -g -Wall OBJS = sml_server.o + +ifeq ($(UNAME), Linux) +LIBS = -L../sml/lib/ ../sml/lib/libsml.o -luuid +endif +ifeq ($(UNAME), Darwin) LIBS = -L../sml/lib/ ../sml/lib/libsml.o +endif + sml_server : $(OBJS) $(CC) $(CFLAGS) $(LIBS) -o sml_server $(OBJS) diff --git a/test/Makefile b/test/Makefile index de48c52..8841875 100644 --- a/test/Makefile +++ b/test/Makefile @@ -1,6 +1,11 @@ +UNAME := $(shell uname) CFLAGS += -I../sml/include/ -Wall +ifeq ($(UNAME), Linux) +LIBS = -luuid +endif LIBSML = ../sml/lib/libsml.a + UNITY = \ unity/unity.o \ unity/unity_fixture.o @@ -30,7 +35,7 @@ libsml : @$(MAKE) -C ../sml %.o : %.c - $(CC) $(CFLAGS) -c $^ -o $@ + $(CC) $(CFLAGS) $(LIBS) -c $^ -o $@ .PHONY: clean clean :