]> rtime.felk.cvut.cz Git - frescor/fosa.git/commitdiff
Makefile miguel
authorsangorrin <sangorrin@35b4ef3e-fd22-0410-ab77-dab3279adceb>
Thu, 7 Jun 2007 16:15:35 +0000 (16:15 +0000)
committersangorrin <sangorrin@35b4ef3e-fd22-0410-ab77-dab3279adceb>
Thu, 7 Jun 2007 16:15:35 +0000 (16:15 +0000)
git-svn-id: http://www.frescor.org/private/svn/frescor/fosa/trunk@445 35b4ef3e-fd22-0410-ab77-dab3279adceb

src_marte/Makefile

index f381e14372d4a8445ba1b30f99f139e8bdf7bc87..8a7e45af20bc2247d0818dae85dcd580183f54ca 100644 (file)
@@ -1,38 +1,67 @@
-.PHONY: clean all
-MARTE_PATH=$(HOME)/marte
-CC=mgcc
-CFLAGS= -DMARTE_OS -g -Wall -I../include -I../../frsh/include -L../lib
-OBJS=$(patsubst %.c,%.o,$(wildcard *.c))
-FOSA_HEADERS=$(wildcard ../include/*.h)
-FRSH_FOSA_HEADERS=$(wildcard ../../frsh/include/frsh_fosa*.h)
-
-all: libfosa
-
-libfosa: $(OBJS) $(FOSA_HEADERS) $(FRSH_FOSA_HEADERS)
-       @exec echo -en "\n>> Generating libfosa.a: ";
-       @$(AR) -rc ../lib/libfosa.a $(OBJS)
-       @exec echo "  [OK]"
-
-%.o: %.c
-       @exec echo -en "\n>> Compiling $<: ";
-       @$(CC) -c $(CFLAGS) $< 1> /dev/null
-       @exec echo -n "  [OK]"
-
-test_fosa: libfosa
-       @exec echo -en "\n>> Compiling and Linking test_fosa.c: ";
-       @$(CC) $(CFLAGS) -lfosa test_fosa.c  1> /dev/null
-       @exec echo "  [OK]"
-
-test_fosa_ads: libfosa $(MARTE_PATH)/misc/load.o
-       @exec echo -en "\n>> Compiling and Linking test_fosa_ads.c: ";
-       @$(CC) $(CFLAGS) -lfosa test_fosa_ads.c $(MARTE_PATH)/misc/load.o 1> /dev/null
-       @exec echo "  [OK]"
-
-$(MARTE_PATH)/misc/load.o: $(MARTE_PATH)/misc/load.c
-       @mgcc $(CFLAGS) -c -o $(MARTE_PATH)/misc/load.o $(MARTE_PATH)/misc/load.c 1> /dev/null
-
-clean:
-       @exec echo -e "\n>> Cleaning up FOSA: ";
-       @find \( -name '*.[oa]' -or -name '*~*' -or -name 'mprogram*' \) -print -delete
-       @rm -f ../lib/libfosa.a
-       @exec echo "  [OK]"
+
+##
+## Makefile for FSF/FRSH C library
+##                             by Miguel Telleria de Esteban
+##                                Univ. de Cantabria
+##                                telleriam@unican.es
+##
+## --------------------------------------------
+
+
+# Here we define FRSHPATH, IPATH, OBJOPT, LPATH, EXTRALIBS, CFLAGS, LDFLAGS
+
+PLATFORM = MARTE_OS
+
+include ../../frsh/frsh_rules.mk
+
+# List of files #
+#################
+NAME   = libfosa_marte.a
+
+SRC        = fosa_clocks_and_timers.c fosa_threads_and_signals.c frsh_fosa.c fosa_mutexes_and_condvars.c \
+             fosa_app_def_sched.c 
+
+PUBLIC_H_FOSA = fosa_app_def_sched.h   fosa.h   fosa_opaque_types.h   fosa_clocks_and_timers.h  \
+                fosa_configuration_parameters.h  fosa_mutexes_and_condvars.h  fosa_threads_and_signals.h  \
+                fosa_types.h
+
+PUBLIC_H_FRSH_FOSA = frsh_fosa.h  frsh_fosa_opaque.h
+
+# PRIVATE_H = 
+
+OBJS   = $(SRC:.c=.o) 
+PUBLIC_H_LOCATIONS = $(addprefix $(FOSAPATH)/include/, $(PUBLIC_H_FOSA) )  $(addprefix $(FRSHPATH)/include, $(PUBLIC_H_FRSH_FOSA) )
+
+# Library and linking  rules #
+##############################
+
+all:   ../lib/$(NAME)
+
+../lib/$(NAME): $(OBJS)
+# $@ represents the target (in this case ../lib/$(NAME) )
+       $(AR) -rc $@ $(OBJS)
+
+
+mprogram-test:  test_fosa.o ../lib/$(NAME)
+       $(CC) -o $@ -lfosa_marte $(LDFLAGS) $<
+
+
+
+# Compilation rule:  For simplicity we make all sources #
+# depend on all header files.                           #
+#########################################################
+%.o: %.c $(PUBLIC_H_FILE_LOCATIONS) $(PRIVATE_H)
+# $< represents the first prerequisite (in this case %.c)
+       $(CC) $(CFLAGS) $(SRC_IPATH) -c $< 
+
+# Clean up #
+############
+clean: lib-uninstall
+       rm -f $(OBJS) *~ sizes.o mprogram-sizes
+
+lib-uninstall:
+       rm -f ../lib/$(NAME)
+
+
+.PHONY: lib-uninstall clean sizes
+