2 ## Makefile for FSF/FRSH C library
3 ## by Miguel Telleria de Esteban
7 ## Scuola Superiore S. Anna, Pisa
8 # faggioli@gandalf.sssup.it
10 ## --------------------------------------------
13 # Here we define FRSHPATH, IPATH, OBJOPT, LPATH, EXTRALIBS, CFLAGS, LDFLAGS
17 include ../../frsh/frsh_rules.mk
19 # Add AQuoSA needed stuff for the code to compile successfully
21 # this should be parametric !!
22 AQUOSA_DIR = /usr/local/aquosa
24 IPATH += -I$(AQUOSA_DIR)/include/aquosa -I$(AQUOSA_DIR)/include
25 LPATH += -L$(AQUOSA_DIR)/lib
26 EXTRALIBS += -lqreslib -lqsuplib
28 # this two should go into frsh_rules.mk !!
29 EXTRALIBS += -lpthread
31 # this should be parametric
32 #OBJOPT += -DFRSH_CONFIG_ENABLE_DEBUG -DFRSH_CONFIG_ENABLE_DEBUG_ASSERTS \
33 -DFRSH_CONFIG_ENABLE_SERVICE_TH_MULTITHREAD \
34 -DFRSH_CONFIG_SERVICE_TH_LOCAL_MACHINE \
35 -DFRSH_CONFIG_ENABLE_SERVICE_TH_SAFETY_CHECK
40 STATIC_NAME = libfosa_qres.a
41 SHARED_NAME = libfosa_qres.so
43 SRC = fosa_clocks_and_timers.c fosa_threads_and_signals.c fosa_mutexes_and_condvars.c
45 PUBLIC_H_FOSA = fosa_app_def_sched.h fosa.h fosa_opaque_types.h fosa_clocks_and_timers.h \
46 fosa_configuration_parameters.h fosa_mutexes_and_condvars.h fosa_threads_and_signals.h \
53 PUBLIC_H_LOCATIONS = $(addprefix $(FOSAPATH)/include/, $(PUBLIC_H_FOSA) ) $(addprefix $(FRSHPATH)/include, $(PUBLIC_H_FRSH_FOSA) )
55 # Library and linking rules #
56 ##############################
58 all: ../lib/$(STATIC_NAME) ../lib/$(SHARED_NAME)
60 ../lib/$(STATIC_NAME): $(OBJS)
61 @exec echo -n "=> Generating libfosa_qres.a: ";
66 ../lib/$(SHARED_NAME): $(OBJS)
67 @exec echo -n "=> Generating libfosa_qres.so: ";
68 $(CC) -shared -o $@ $(OBJS)
72 # Compilation rule: For simplicity we make all sources #
73 # depend on all header files. #
74 # NB. $< represents the first prerequisite (in this case %.c) #
75 ###############################################################
77 %.o: %.c $(PUBLIC_H_FILE_LOCATIONS) $(PRIVATE_H)
78 @exec echo -n "=> Compiling $<: ";
86 @exec echo -n "=> Cleaning up FOSA: ";
91 @exec echo -n "=> Removing FOSA library files: ";
92 -@rm -f ../lib/$(STATIC_NAME)
93 -@rm -f ../lib/$(SHARED_NAME)
97 .PHONY: lib-uninstall clean