## ## Makefile for FSF/FRSH C library ## by Miguel Telleria de Esteban ## Univ. de Cantabria ## telleriam@unican.es ## by Dario Faggioli ## Scuola Superiore S. Anna, Pisa # faggioli@gandalf.sssup.it ## ## -------------------------------------------- # Here we define FRSHPATH, IPATH, OBJOPT, LPATH, EXTRALIBS, CFLAGS, LDFLAGS PLATFORM = AQuoSA include ../../frsh/frsh_rules.mk # Add AQuoSA needed stuff for the code to compile successfully # this should be parametric !! AQUOSA_DIR = /usr/local/aquosa IPATH += -I$(AQUOSA_DIR)/include/aquosa -I$(AQUOSA_DIR)/include LPATH += -L$(AQUOSA_DIR)/lib EXTRALIBS += -lqreslib -lqsuplib # this two should go into frsh_rules.mk !! EXTRALIBS += -lpthread OBJOPT += -fPIC # this should be parametric #OBJOPT += -DFRSH_CONFIG_ENABLE_DEBUG -DFRSH_CONFIG_ENABLE_DEBUG_ASSERTS \ -DFRSH_CONFIG_ENABLE_SERVICE_TH_MULTITHREAD \ -DFRSH_CONFIG_SERVICE_TH_LOCAL_MACHINE \ -DFRSH_CONFIG_ENABLE_SERVICE_TH_SAFETY_CHECK # List of files # ################# STATIC_NAME = libfosa_qres.a SHARED_NAME = libfosa_qres.so SRC = fosa_clocks_and_timers.c fosa_threads_and_signals.c frsh_fosa.c fosa_mutexes_and_condvars.c PUBLIC_H_FOSA = fosa_app_def_sched.h fosa.h fosa_opaque_types.h fosa_clocks_and_timers.h \ fosa_configuration_parameters.h fosa_mutexes_and_condvars.h fosa_threads_and_signals.h \ fosa_types.h PUBLIC_H_FRSH_FOSA = frsh_fosa.h frsh_fosa_opaque.h OBJS = $(SRC:.c=.o) PUBLIC_H_LOCATIONS = $(addprefix $(FOSAPATH)/include/, $(PUBLIC_H_FOSA) ) $(addprefix $(FRSHPATH)/include, $(PUBLIC_H_FRSH_FOSA) ) # Library and linking rules # ############################## all: ../lib/$(STATIC_NAME) ../lib/$(SHARED_NAME) ../lib/$(STATIC_NAME): $(OBJS) @exec echo -n "=> Generating libfosa_qres.a: "; @$(AR) -rc $@ $(OBJS) # $(RANLIB) $@ @exec echo " [OK]" ../lib/$(SHARED_NAME): $(OBJS) @exec echo -n "=> Generating libfosa_qres.so: "; @$(CC) -shared -o $@ $(OBJS) @exec echo " [OK]" # Compilation rule: For simplicity we make all sources # # depend on all header files. # # NB. $< represents the first prerequisite (in this case %.c) # ############################################################### %.o: %.c $(PUBLIC_H_FILE_LOCATIONS) $(PRIVATE_H) @exec echo -n "=> Compiling $<: "; @$(CC) $(CFLAGS) -c $< @exec echo " [OK]" # Clean up # ############ clean: lib-uninstall @exec echo -n "=> Cleaning up FOSA: "; -@rm -f $(OBJS) @exec echo " [OK]" lib-uninstall: @exec echo -n "=> Removing FOSA library files: "; -@rm -f ../lib/$(STATIC_NAME) -@rm -f ../lib/$(SHARED_NAME) @exec echo " [OK]" .PHONY: lib-uninstall clean