diff options
author | dianshi <dos21h@gmail.com> | 2022-03-11 17:02:59 +0000 |
---|---|---|
committer | dianshi <dos21h@gmail.com> | 2022-03-11 17:02:59 +0000 |
commit | ecb31e7903fa8c24ea99f2d4ee07975b5a3b90ac (patch) | |
tree | 37a930d922c965c7e8ce6f48fdbcc65b01d85404 | |
parent | 5ee81fbbaf5c6a3bbc583d37ce324cf8546dc9aa (diff) | |
download | librusb-ecb31e7903fa8c24ea99f2d4ee07975b5a3b90ac.tar.gz librusb-ecb31e7903fa8c24ea99f2d4ee07975b5a3b90ac.zip |
-rw-r--r-- | Makefile | 3 | ||||
-rw-r--r-- | include/linux/config.h (renamed from src/config.h) | 0 | ||||
-rw-r--r-- | include/macos/config.h | 37 | ||||
-rw-r--r-- | src/make.mk | 20 |
4 files changed, 54 insertions, 6 deletions
@@ -15,7 +15,8 @@ OBJ_OS= BUILD_DIR=build/ -include src/make.mk +OS=linux +include src/make.mk SOURCES+=$(wildcard src/*.c) SOURCES+=$(wildcard src/os/*.c) diff --git a/src/config.h b/include/linux/config.h index 97a82c2..97a82c2 100644 --- a/src/config.h +++ b/include/linux/config.h diff --git a/include/macos/config.h b/include/macos/config.h new file mode 100644 index 0000000..59f3463 --- /dev/null +++ b/include/macos/config.h @@ -0,0 +1,37 @@ +/* config.h. Manually generated for Xcode. */ + +#include <AvailabilityMacros.h> + +/* Define to the attribute for default visibility. */ +#define DEFAULT_VISIBILITY __attribute__ ((visibility ("default"))) + +/* Define to 1 to enable message logging. */ +#define ENABLE_LOGGING 1 + +/* On 10.12 and later, use newly available clock_*() functions */ +#if MAC_OS_X_VERSION_MIN_REQUIRED >= 101200 +/* Define to 1 if you have the `clock_gettime' function. */ +#define HAVE_CLOCK_GETTIME 1 +#endif + +/* On 10.6 and later, use newly available pthread_threadid_np() function */ +#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060 +/* Define to 1 if you have the 'pthread_threadid_np' function. */ +#define HAVE_PTHREAD_THREADID_NP 1 +#endif + +/* Define to 1 if the system has the type `nfds_t'. */ +#define HAVE_NFDS_T 1 + +/* Define to 1 if you have the <sys/time.h> header file. */ +#define HAVE_SYS_TIME_H 1 + +/* Define to 1 if compiling for a POSIX platform. */ +#define PLATFORM_POSIX 1 + +/* Define to the attribute for enabling parameter checks on printf-like + functions. */ +#define PRINTF_FORMAT(a, b) __attribute__ ((__format__ (__printf__, a, b))) + +/* Enable GNU extensions. */ +#define _GNU_SOURCE 1 diff --git a/src/make.mk b/src/make.mk index 85d90e8..8f17b8d 100644 --- a/src/make.mk +++ b/src/make.mk @@ -1,7 +1,7 @@ DIR=src -SRC_UTILS_PRE += $(wildcard $(DIR)/os/*.c) SRC_UTILS += $(wildcard $(DIR)/*.c) +SRC_UTILS_PRE += $(wildcard $(DIR)/os/*.c) SRC_UTILS_PRE_L += $(wildcard $(DIR)/os/linux/*.c) SRC_UTILS_PRE_M = $(wildcard $(DIR)/os/macos/*.c) OBJ_UTILS += $(SRC_UTILS:.c=.o) @@ -10,7 +10,16 @@ OBJ_UTILS_PRE_M += $(SRC_UTILS_PRE_M:.c=.o) OBJ_UTILS_PRE_L += $(SRC_UTILS_PRE_L:.c=.o) LDFLAGS_UTILS = INCLUDE = -I./include -I./src +INCLUDE_L = -I./include/linux +INCLUDE_M = -I./include/macos CFLAGS = -fPIC +OS = linux + + + +build-src: INCLUDE += $(INCLUDE_L) + + build-src: src-pre echo "Hello" @@ -18,7 +27,7 @@ build-src: src-pre echo $(SRC_UTILS) - +build-src-macos: INCLUDE += $(INCLUDE_M) build-src-macos: print src-pre-macos echo "Build macos" @@ -27,10 +36,10 @@ print: echo "$(OBJ_UTILS_PRE_M)" echo "$(OBJ_UTILS)" -$(DIR)-pre-macos: $(OBJ_UTILS_PRE) $(OBJ_UTILS_PRE_M) $(OBJ_UTILS) +$(DIR)-pre-macos: $(OBJ_UTILS) $(OBJ_UTILS_PRE) $(OBJ_UTILS_PRE_M) echo "here 2" -$(DIR)-pre: $(OBJ_UTILS_PRE) $(OBJ_UTILS_PRE_L) $(OBJ_UTILS) +$(DIR)-pre: $(OBJ_UTILS) $(OBJ_UTILS_PRE) $(OBJ_UTILS_PRE_L) echo "here 1" $(DIR)/os/%.o: $(DIR)/os/%.c @@ -39,4 +48,5 @@ $(DIR)/os/%.o: $(DIR)/os/%.c $(DIR)/%.o: $(DIR)/%.c echo "B" - $(CC) $(CFLAGS) $(INCLUDE) -c $< -o $(BUILD_DIR)$@ $(LDFLAGS_UTILS)
\ No newline at end of file + $(CC) $(CFLAGS) $(INCLUDE) -c $< -o $(BUILD_DIR)$@ $(LDFLAGS_UTILS) + |