diff --git a/Makefile b/Makefile index b684ec9..88c4016 100644 --- a/Makefile +++ b/Makefile @@ -60,13 +60,9 @@ endif default: lz4programs -all: lz4lib lz4programs - -lz4lib: +all: @cd $(LZ4DIR); $(MAKE) -e all - -lz4lib-djgpp: - @cd $(LZ4DIR); $(MAKE) -e liblz4-static + @cd $(PRGDIR); $(MAKE) -e all lz4programs: @cd $(PRGDIR); $(MAKE) -e diff --git a/lib/Makefile b/lib/Makefile index 787e971..4be1499 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -40,7 +40,7 @@ LIBVER=$(LIBVER_MAJOR).$(LIBVER_MINOR).$(LIBVER_PATCH) DESTDIR?= PREFIX ?= /usr/local CFLAGS ?= -O3 -CFLAGS += -I. -std=gnu99 -Wall -Wextra -Wundef -Wshadow -Wcast-align -Wcast-qual -Wstrict-prototypes -pedantic +CFLAGS += -I. -std=c99 -Wall -Wextra -Wundef -Wshadow -Wcast-align -Wcast-qual -Wstrict-prototypes -pedantic LIBDIR?= $(PREFIX)/lib INCLUDEDIR=$(PREFIX)/include @@ -60,26 +60,20 @@ else SHARED_EXT_VER = $(SHARED_EXT).$(LIBVER) endif -.PHONY: default all liblz4 liblz4-static clean install uninstall - default: liblz4 all: liblz4 -liblz4: liblz4.a lz4.c lz4hc.c lz4frame.c xxhash.c +liblz4: lz4.c lz4hc.c lz4frame.c xxhash.c + @echo compiling static library + @$(CC) $(CPPFLAGS) $(CFLAGS) -fPIC -c $^ + @$(AR) rcs liblz4.a lz4.o lz4hc.o lz4frame.o xxhash.o @echo compiling dynamic library $(LIBVER) @$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -shared $^ -fPIC $(SONAME_FLAGS) -o $@.$(SHARED_EXT_VER) @echo creating versioned links @ln -sf $@.$(SHARED_EXT_VER) $@.$(SHARED_EXT_MAJOR) @ln -sf $@.$(SHARED_EXT_VER) $@.$(SHARED_EXT) -liblz4.a: lz4.c lz4hc.c lz4frame.c xxhash.c - @echo compiling static library - @$(CC) $(CPPFLAGS) $(CFLAGS) -fPIC -c $^ - @$(AR) rcs liblz4.a lz4.o lz4hc.o lz4frame.o xxhash.o - -liblz4-static: liblz4.a - clean: @rm -f core *.o *.a *.$(SHARED_EXT) *.$(SHARED_EXT).* liblz4.pc @echo Cleaning library completed diff --git a/programs/Makefile b/programs/Makefile index 5e818e4..39335db 100644 --- a/programs/Makefile +++ b/programs/Makefile @@ -39,7 +39,7 @@ RELEASE?= r129 DESTDIR?= PREFIX ?= /usr/local CFLAGS ?= -O3 -CFLAGS += -std=gnu99 -Wall -Wextra -Wundef -Wshadow -Wcast-qual -Wcast-align -Wstrict-prototypes -pedantic -DLZ4_VERSION=\"$(RELEASE)\" +CFLAGS += -std=c99 -Wall -Wextra -Wundef -Wshadow -Wcast-qual -Wcast-align -Wstrict-prototypes -pedantic -DLZ4_VERSION=\"$(RELEASE)\" FLAGS := -I../lib $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) BINDIR := $(PREFIX)/bin