]> rtime.felk.cvut.cz Git - frescor/fosa.git/blob - src_aquosa/Makefile
8115b607a90321828c360dc32f00fb57fbb3de85
[frescor/fosa.git] / src_aquosa / Makefile
1 ##
2 ## Makefile for FSF/FRSH C library
3 ##                              by Miguel Telleria de Esteban
4 ##                                 Univ. de Cantabria
5 ##                                 telleriam@unican.es
6 ##                              by Dario Faggioli
7 ##                                 Scuola Superiore S. Anna, Pisa
8 #                                  faggioli@gandalf.sssup.it
9 ##
10 ## --------------------------------------------
11
12
13 # Here we define FRSHPATH, IPATH, OBJOPT, LPATH, EXTRALIBS, CFLAGS, LDFLAGS
14
15 include ../../frsh/frsh_rules.mk
16
17 PLATFORM=AQuoSA
18
19 # Add AQuoSA needed stuff for the code to compile successfully
20
21 # this should be parametric !!
22 AQUOSA_DIR = /usr/local/aquosa
23
24 IPATH += -I$(AQUOSA_DIR)/include/aquosa -I$(AQUOSA_DIR)/include
25 LPATH += -L$(AQUOSA_DIR)/lib
26 EXTRALIBS += -lqreslib -lqsuplib
27
28 # this two should go into frsh_rules.mk !!
29 EXTRALIBS += -lpthread
30 OBJOPT += -fPIC
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
36
37 # List of files #
38 #################
39
40 STATIC_NAME = libfosa_qres.a
41 SHARED_NAME = libfosa_qres.so
42
43 SRC = fosa_clocks_and_timers.c fosa_long_jump.c fosa_threads_and_signals.c fosa_mutexes_and_condvars.c fosa_time.c fosa_platform_values.c fosa_app_def_sched.c fosa_group_clocks.c
44
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 \
47                 fosa_types.h fosa_group_clocks.h
48
49 PUBLIC_H_FRSH_FOSA =
50
51 OBJS = $(SRC:.c=.o)
52
53 PUBLIC_H_LOCATIONS = $(addprefix $(FOSAPATH)/include/, $(PUBLIC_H_FOSA) )  $(addprefix $(FRSHPATH)/include, $(PUBLIC_H_FRSH_FOSA) )
54
55 # Library and linking  rules #
56 ##############################
57
58 all: ../lib/$(STATIC_NAME) ../lib/$(SHARED_NAME)
59
60 ../lib/$(STATIC_NAME): $(OBJS)
61         @exec echo -n "=> Generating libfosa_qres.a: ";
62         @$(AR) -rc $@ $(OBJS)
63 #       $(RANLIB) $@
64         @exec echo "  [OK]"
65
66 ../lib/$(SHARED_NAME): $(OBJS)
67         @exec echo -n "=> Generating libfosa_qres.so: ";
68         @$(CC) -shared -o $@ $(OBJS)
69         @exec echo "  [OK]"
70
71
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 ###############################################################
76
77 %.o: %.c $(PUBLIC_H_FILE_LOCATIONS) $(PRIVATE_H)
78         @@exec echo -n "=> Compiling $<: ";
79         @$(CC) $(CFLAGS) -c $<
80         @exec echo "  [OK]"
81
82 # Clean up #
83 ############
84
85 clean: lib-uninstall
86         @exec echo -n "=> Cleaning up FOSA: ";
87         -@rm -f $(OBJS)
88         @exec echo "  [OK]"
89
90 lib-uninstall:
91         @exec echo -n "=> Removing FOSA library files: ";
92         -@rm -f ../lib/$(STATIC_NAME)
93         -@rm -f ../lib/$(SHARED_NAME)
94         @exec echo "  [OK]"
95
96
97 .PHONY: lib-uninstall clean
98