3 ## Makefile for FSF/FRSH C library
4 ## by Miguel Telleria de Esteban
8 ## --------------------------------------------
11 # Here we define FRSHPATH, IPATH, OBJOPT, LPATH, EXTRALIBS, CFLAGS, LDFLAGS
15 include ../../frsh/frsh_rules.mk
19 NAME = libfosa_marte.a
21 SRC = fosa_clocks_and_timers.c fosa_threads_and_signals.c frsh_fosa.c fosa_mutexes_and_condvars.c \
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 \
28 PUBLIC_H_FRSH_FOSA = frsh_fosa.h frsh_fosa_opaque.h
33 PUBLIC_H_LOCATIONS = $(addprefix $(FOSAPATH)/include/, $(PUBLIC_H_FOSA) ) $(addprefix $(FRSHPATH)/include, $(PUBLIC_H_FRSH_FOSA) )
35 # Library and linking rules #
36 ##############################
40 ../lib/$(NAME): $(OBJS)
41 # $@ represents the target (in this case ../lib/$(NAME) )
45 mprogram-test: test_fosa.o ../lib/$(NAME)
46 $(CC) -o $@ -lfosa_marte $(LDFLAGS) $<
50 # Compilation rule: For simplicity we make all sources #
51 # depend on all header files. #
52 #########################################################
53 %.o: %.c $(PUBLIC_H_FILE_LOCATIONS) $(PRIVATE_H)
54 # $< represents the first prerequisite (in this case %.c)
55 $(CC) $(CFLAGS) $(SRC_IPATH) -c $<
60 rm -f $(OBJS) *~ sizes.o mprogram-sizes
66 .PHONY: lib-uninstall clean sizes