# # pthread emulation library # kBuild makefile # # please define (as env variables or kmk command line) the following variables before starting: # BUILD_PLATFORM = os2 # BUILD_TYPE = release|debug # # Edit Config.kmk to match your installation. # DEPTH = .. SUB_DEPTH = .. include $(KBUILD_PATH)/subheader.kmk TOOL = GCC3 DLLS = pthread LIBRARIES = pthread_s pthread_g pthread_dll pthread_s_SOURCES = \ pthread_attr.c \ rwlock.c \ my_os2cond.c \ my_os2mutex.c \ my_os2thread.c \ my_os2key.c \ my_os2tls.c pthread_s_CFLAGS = -g -std=c99 -Wall -DNO_DYNAMIC_LIB $(KCFLAGS) pthread_s_DEFS = pthread_s_INCS = pthread_s_LDFLAGS = -g -Zomf -Zmap -Zhigh-mem pthread_s_LIBS = cx pthread_s_CLEAN = $(PATH_INST_LIB)/pthread_s.a pthread_g_SOURCES = $(pthread_s_SOURCES) pthread_g_CFLAGS = -g -O0 -std=c99 -DDEBUG_PRINTF -DNO_DYNAMIC_LIB pthread_g_DEFS = pthread_g_INCS = pthread_g_LDFLAGS = -g -Zomf -Zmap -Zhigh-mem pthread_g_LIBS = cx pthread_g_CLEAN = $(PATH_INST_LIB)/pthread_g.a pthread_NAME = pthr01 pthread_SOURCES = $(pthread_s_SOURCES) # def file pthread_SOURCES += $(PATH_OBJ)/pthread.def pthread_CLEAN += $(PATH_OBJ)/pthread.def pthread_CFLAGS.release = -g -Zomf -std=c99 -Wall $(KCFLAGS) pthread_CFLAGS.debug = -g -O0 -DDEBUG_PRINTF pthread_DEFS = pthread_INCS = pthread_LDFLAGS = -g -Zomf -Zmap -Zhigh-mem -Zdll pthread_LIBS = cx pthread_CLEAN += $(PATH_INST_BIN)/pthr01.dll pthread_dll_TOOL = GCC3 pthread_dll_NAME = pthread pthread_dll_SOURCES = pthread.def pthread_dll_CLEAN = $(PATH_INST_LIB)/pthread.a $(PATH_OBJ)/pthread.def: $(PATH_SUB_CURRENT)/pthread.def $(BUILD_VERSION_DEPS) | $(call DIRDEP,$(PATH_OBJ)) $(call MSG_L1,Generating $@) $(QUIET)cp $< $@ $(QUIET)echo DESCRIPTION '"$(BUILD_BLDLEVEL)pthread implementation for OS/2"' >> $@ # install some more files INSTALLS = pthread-headers pthread-headers_INST = include/ pthread-headers_SOURCES = pthread.h pthread-headers_CLEAN = $(PATH_INS)/include/pthread.h # packaging stuffs PACKAGE_NAME = pthread-$(subst .,_,$(VERSION))-$(BUILD).zip PACKING += $(PATH_ROOT)/dist/$(PACKAGE_NAME) OTHER_CLEAN += $(PATH_ROOT)/dist/$(PACKAGE_NAME) # now include standard code include $(PATH_KBUILD)/rules.kMk # here follows standard gnu make inference rules # final: zip all files! $(PATH_ROOT)/dist/$(PACKAGE_NAME): $(INSTARGET_pthread_g) $(INSTARGET_pthread) $(call MSG_L1,Packing $@) $(QUIET)$(MKDIR) -p $(PATH_ROOT)/dist $(QUIET)$(REDIRECT) -C $(DEPTH) -- zip -9q $@ src/* -x src/*~ $(QUIET)$(REDIRECT) -C $(PATH_INS) -- zip -9q $@ lib/* bin/* include/* # put build files into root dir build: $(INSTARGET_pthread_g) $(INSTARGET_pthread) $(QUIET)cp $(PATH_INS)/lib/*.* $(PATH_ROOT) $(QUIET)cp $(PATH_INS)/include/*.* $(PATH_ROOT)