Makefile.eNB 2.26 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
#/*
# * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
# * contributor license agreements.  See the NOTICE file distributed with
# * this work for additional information regarding copyright ownership.
# * The OpenAirInterface Software Alliance licenses this file to You under
# * the OAI Public License, Version 1.0  (the "License"); you may not use this file
# * except in compliance with the License.
# * You may obtain a copy of the License at
# *
# *      http://www.openairinterface.org/?page_id=698
# *
# * Unless required by applicable law or agreed to in writing, software
# * distributed under the License is distributed on an "AS IS" BASIS,
# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# * See the License for the specific language governing permissions and
# * limitations under the License.
# *-------------------------------------------------------------------------------
# * For more information about the OpenAirInterface (OAI) Software Alliance:
# *      contact@openairinterface.org
# */

gauthier's avatar
gauthier committed
22
OUTDIR = .
23 24 25 26 27 28 29

libgtpv1u_OBJECTS = \
	nw-gtpv1u/src/NwGtpv1uTunnelEndPoint.o	\
	nw-gtpv1u/src/NwGtpv1uTrxn.o 	\
	nw-gtpv1u/src/NwGtpv1uMsg.o 	\
	nw-gtpv1u/src/NwGtpv1u.o 	\
	gtpv1u_eNB.o	\
30
	gtpv1u_teid_pool.o
31

gauthier's avatar
gauthier committed
32 33 34
# pull in dependency info for *existing* .o files
-include $(OUTDIR)/*.d

35 36
CFLAGS = \
	-Wall			\
gauthier's avatar
gauthier committed
37 38 39
	$(GTPV1U_CFLAGS)		\
	-DENB_MODE		\
	-Werror=uninitialized	\
40 41
	-Werror=implicit-function-declaration

gauthier's avatar
gauthier committed
42
$(OUTDIR)/%.o : %.c
43
	@echo "Compiling $<"
gauthier's avatar
gauthier committed
44
	@if [ ! -d $(dir $@) ]; then mkdir -p $(dir $@); fi;
45
	@$(CC) -c $(CFLAGS) -o $@ $<
gauthier's avatar
gauthier committed
46 47 48 49 50 51 52 53 54 55 56 57 58
	@$(CC) -MM $(CFLAGS) $< > $(basename $@).d
	@mv -f $(basename $@).d $(basename $@).d.tmp
	@sed -e 's|.*:|$@:|' < $(basename $@).d.tmp > $(basename $@).d
	@sed -e 's/.*://' -e 's/\\$$//' < $(basename $@).d.tmp | fmt -1 | \
	sed -e 's/^ *//' -e 's/$$/:/' >> $(basename $@).d
	@rm -f $(basename $@).d.tmp

objsdir:
	@if [ ! -d $(OUTDIR) ]; then mkdir -p $(OUTDIR); fi;

$(OUTDIR)/libgtpv1u.a: $(addprefix $(OUTDIR)/,$(libgtpv1u_OBJECTS))
	@echo Creating GTPV1U archive
	@$(AR) rcs $@ $(addprefix $(OUTDIR)/,$(libgtpv1u_OBJECTS))
59 60

clean:
61 62
	@$(RM_F_V) $(OUTDIR)/nw-gtpv1u/src/*.o
	@$(RM_F_V) $(OUTDIR)/nw-gtpv1u/src/*.d
gauthier's avatar
gauthier committed
63 64 65 66
	@$(RM_F_V) $(OUTDIR)/*.o
	@$(RM_F_V) $(OUTDIR)/*.d
	@$(RM_F_V) $(OUTDIR)/libgtpv1u.a

67
cleanall: clean