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_$(PLATFORM).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_fosa: test_fosa.c ../lib/$(NAME)
46 $(CC) -o $@ -lfosa_$(PLATFORM) $(LDFLAGS) $<
48 mprogram-test_fosa_ads: test_fosa_ads.c ../lib/$(NAME)
49 $(CC) -o $@ -lfosa_$(PLATFORM) $(LDFLAGS) $<
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 $<
63 rm -f $(OBJS) *~ sizes.o mprogram-sizes test_fosa.o test_fosa
69 .PHONY: lib-uninstall clean sizes