]> rtime.felk.cvut.cz Git - frescor/fosa.git/blob - src_marte/Makefile
Adding $(PLATFORM) to libfosa.a file
[frescor/fosa.git] / src_marte / Makefile
1
2 ##
3 ## Makefile for FSF/FRSH C library
4 ##                              by Miguel Telleria de Esteban
5 ##                                 Univ. de Cantabria
6 ##                                 telleriam@unican.es
7 ##
8 ## --------------------------------------------
9
10
11 # Here we define FRSHPATH, IPATH, OBJOPT, LPATH, EXTRALIBS, CFLAGS, LDFLAGS
12
13 PLATFORM = MARTE_OS
14
15 include ../../frsh/frsh_rules.mk
16
17 # List of files #
18 #################
19 NAME    = libfosa_$(PLATFORM).a
20
21 SRC         = fosa_clocks_and_timers.c fosa_threads_and_signals.c frsh_fosa.c fosa_mutexes_and_condvars.c \
22               fosa_app_def_sched.c 
23
24 PUBLIC_H_FOSA = fosa_app_def_sched.h   fosa.h   fosa_opaque_types.h   fosa_clocks_and_timers.h  \
25                 fosa_configuration_parameters.h  fosa_mutexes_and_condvars.h  fosa_threads_and_signals.h  \
26                 fosa_types.h
27
28 PUBLIC_H_FRSH_FOSA = frsh_fosa.h  frsh_fosa_opaque.h
29
30 # PRIVATE_H = 
31
32 OBJS    = $(SRC:.c=.o) 
33 PUBLIC_H_LOCATIONS = $(addprefix $(FOSAPATH)/include/, $(PUBLIC_H_FOSA) )  $(addprefix $(FRSHPATH)/include, $(PUBLIC_H_FRSH_FOSA) )
34
35 # Library and linking  rules #
36 ##############################
37
38 all:    ../lib/$(NAME)
39
40 ../lib/$(NAME): $(OBJS)
41 # $@ represents the target (in this case ../lib/$(NAME) )
42         $(AR) -rc $@ $(OBJS)
43
44
45 mprogram-test_fosa:  test_fosa.c ../lib/$(NAME)
46         $(CC) -o $@ -lfosa_$(PLATFORM) $(LDFLAGS) $<
47
48 mprogram-test_fosa_ads:  test_fosa_ads.c ../lib/$(NAME)
49         $(CC) -o $@ -lfosa_$(PLATFORM) $(LDFLAGS) $<
50
51
52
53 # Compilation rule:  For simplicity we make all sources #
54 # depend on all header files.                           #
55 #########################################################
56 %.o: %.c $(PUBLIC_H_FILE_LOCATIONS) $(PRIVATE_H)
57 # $< represents the first prerequisite (in this case %.c)
58         $(CC) $(CFLAGS) $(SRC_IPATH) -c $< 
59
60 # Clean up #
61 ############
62 clean: lib-uninstall
63         rm -f $(OBJS) *~ sizes.o mprogram-sizes test_fosa.o test_fosa
64
65 lib-uninstall:
66         rm -f ../lib/$(NAME)
67
68
69 .PHONY: lib-uninstall clean sizes
70