Skip to content

Commit

Permalink
Platform independent build
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeroen van der Heijden committed Aug 31, 2017
1 parent f5f6c19 commit 79d5a79
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 13 deletions.
6 changes: 6 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
libqpack (0.10.3)

* Make build script platform independent.

-- Jeroen van der Heijden <jeroen@transceptor.technology> 31 Aug 2017

libqpack (0.10.2)

* Added qp_sprint() for printing qp data to a string. Like qp_fprint() the
Expand Down
17 changes: 13 additions & 4 deletions Debug/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,31 @@ endif

-include ../makefile.defs

OS := $(shell uname)
ifeq ($(OS),Darwin)
FN := libqpack.dylib
INSTALL_PATH := /usr/local
else
FN := libqpack.so
INSTALL_PATH := /usr
endif

# Add inputs and outputs from these tool invocations to the build variables

# All Target
all: libqpack.so
all: libqpack

# Tool invocations
libqpack.so: $(OBJS) $(USER_OBJS)
libqpack: $(OBJS) $(USER_OBJS)
@echo 'Building target: $@'
@echo 'Invoking: Cross GCC Linker'
gcc -shared -o "libqpack.so" $(OBJS) $(USER_OBJS) $(LIBS)
gcc -shared -o $(FN) $(OBJS) $(USER_OBJS) $(LIBS) $(LDFLAGS)
@echo 'Finished building target: $@'
@echo ' '

# Other Targets
clean:
-$(RM) $(LIBRARIES)$(OBJS)$(C_DEPS) libqpack.so
-$(RM) $(LIBRARIES)$(OBJS)$(C_DEPS) $(FN)
-@echo ' '

.PHONY: all clean dependents
Expand Down
17 changes: 13 additions & 4 deletions Release/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,31 @@ endif

-include ../makefile.defs

OS := $(shell uname)
ifeq ($(OS),Darwin)
FN := libqpack.dylib
INSTALL_PATH := /usr/local
else
FN := libqpack.so
INSTALL_PATH := /usr
endif

# Add inputs and outputs from these tool invocations to the build variables

# All Target
all: libqpack.so
all: libqpack

# Tool invocations
libqpack.so: $(OBJS) $(USER_OBJS)
libqpack: $(OBJS) $(USER_OBJS)
@echo 'Building target: $@'
@echo 'Invoking: Cross GCC Linker'
gcc -shared -o "libqpack.so" $(OBJS) $(USER_OBJS) $(LIBS)
gcc -shared -o $(FN) $(OBJS) $(USER_OBJS) $(LIBS) $(LDFLAGS)
@echo 'Finished building target: $@'
@echo ' '

# Other Targets
clean:
-$(RM) $(LIBRARIES)$(OBJS)$(C_DEPS) libqpack.so
-$(RM) $(LIBRARIES)$(OBJS)$(C_DEPS) $(FN)
-@echo ' '

.PHONY: all clean dependents
Expand Down
8 changes: 4 additions & 4 deletions makefile.targets
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
.PHONY: install
install:
@cp ../qpack.h /usr/include/qpack.h
@cp libqpack.so /usr/lib/x86_64-linux-gnu/libqpack.so
@cp ../qpack.h $(INSTALL_PATH)/include/qpack.h
@cp $(FN) $(INSTALL_PATH)/lib/$(FN)

.PHONY: uninstall
uninstall:
@rm -f /usr/include/qpack.h
@rm -f /usr/lib/x86_64-linux-gnu/libqpack.so
@rm -f $(INSTALL_PATH)/include/qpack.h
@rm -f $(INSTALL_PATH)/lib/$(FN)
2 changes: 1 addition & 1 deletion qpack.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

#define QP_VERSION_MAJOR 0
#define QP_VERSION_MINOR 10
#define QP_VERSION_PATCH 2
#define QP_VERSION_PATCH 3

#define QP_STRINGIFY(num) #num
#define QP_VERSION_STR(major,minor,patch) \
Expand Down

0 comments on commit 79d5a79

Please sign in to comment.