From 8febca1a5a791e5d006d59b3e32a7d30cec823a6 Mon Sep 17 00:00:00 2001 From: hadaq Date: Wed, 18 Jul 2012 02:49:39 +0000 Subject: [PATCH] updated make --- HOWTO_COMPILE.TXT | 12 +++++++++++ Makefile | 44 +++++++++++++++++++++++++++++++++++++++-- libtrbnet_perl/makefile | 24 ++++++++++++++++++++++ pexor/Makefile | 10 +++++++--- 4 files changed, 85 insertions(+), 5 deletions(-) create mode 100644 HOWTO_COMPILE.TXT create mode 100644 libtrbnet_perl/makefile diff --git a/HOWTO_COMPILE.TXT b/HOWTO_COMPILE.TXT new file mode 100644 index 0000000..a1269d5 --- /dev/null +++ b/HOWTO_COMPILE.TXT @@ -0,0 +1,12 @@ +compile for old Etrax-Board + make distclean + make ETRAX=1 + +compile for Pexor Card + make distclean + make PEXOR=1 + +compile for old Etrax-Board + make distclean + make TRB3=1 + diff --git a/Makefile b/Makefile index 7cc58d9..4b75140 100644 --- a/Makefile +++ b/Makefile @@ -1,17 +1,34 @@ # ------------ TARGETS ------------------------------------------------- -TARGETS = libtrbnet trbrich trbnetd pexor +ifdef ETRAX +TARGETS = libtrbnet trbrich +else ifdef PEXOR +TARGETS = libtrbnet trbrich trbnetd pexor perllib +else ifdef TRB3 +TARGETS = libtrbnet trbrich trbnetd perllib +else +TARGETS = usage +endif # ------------ Targets ------------------------------------------------- all: $(TARGETS) + +.PHONY: usage +usage: + @echo " for compiling/install you have to define a target, i.e." + @echo " make ETRAX=1 or" + @echo " make PEXOR=1 or" + @echo " make TRB3=1" + .PHONY: clean clean: make -C libtrbnet clean make -C pexor clean make -C trbrich clean make -C trbnetd clean + make -C libtrbnet_perl clean .PHONY: distclean distclean: clean @@ -19,6 +36,7 @@ distclean: clean make -C pexor distclean make -C trbrich distclean make -C trbnetd distclean + make -C libtrbnet_perl distclean rm -rf bin binlocal lib liblocal include kernel-modules .PHONY: cleanrpc @@ -29,11 +47,29 @@ cleanrpc: depend: $(CC) -MM $(CFLAGS) $(CPPFLAGS) $(INCDIR) *.c -install: pexor libtrbnet trbrich trbnetd +.PHONY: install +ifdef ETRAX +install: libtrbnet trbrich make -C libtrbnet install + make -C trbrich install +else ifdef PEXOR +install: libtrbnet trbrich trbnetd pexor + make -C libtrbnet install + make -C trbrich install + make -C trbnetd install make -C pexor install + make -C libtrbnet_perl install +else ifdef TRB3 +install: libtrbnet trbrich trbnetd + make -C libtrbnet install make -C trbrich install make -C trbnetd install + make -C libtrbnet_perl install +else +install: + make usage +endif + # ------------ Dependencies -------------------------------------------- @@ -52,3 +88,7 @@ trbrich: libtrbnet .PHONY: trbnetd trbnetd: libtrbnet make -C trbnetd all + +.PHONY: perllib +perllib: libtrbnet + make -C libtrbnet_perl all diff --git a/libtrbnet_perl/makefile b/libtrbnet_perl/makefile new file mode 100644 index 0000000..6023783 --- /dev/null +++ b/libtrbnet_perl/makefile @@ -0,0 +1,24 @@ + +TARGETS = + +# ------------ Targets ------------------------------------------------- + +all: Makefile + make -f Makefile + +.PHONY: clean +clean: Makefile + make -f Makefile clean + +.PHONY: distclean +distclean: clean + +.PHONY: install +install: Makefile + make -f Makefile install + +# ------------ Dependencies -------------------------------------------- + +Makefile: + perl Makefile.PL + diff --git a/pexor/Makefile b/pexor/Makefile index b6991a5..9139458 100644 --- a/pexor/Makefile +++ b/pexor/Makefile @@ -23,7 +23,7 @@ LOADLIBES = -ltrbnet -lm # ------------ TARGETS ------------------------------------------------- -TARGETS = pexorflash +TARGETS = pexorflash kernel-driver LIB_TARGETS = @@ -86,12 +86,16 @@ distclean: clean depend: $(CC) -MM $(CFLAGS) $(CPPFLAGS) $(INCDIR) *.c -install: $(TARGETS) +install: pexorflash kernel-driver mkdir -m 2775 -p ../binlocal/ - install -m 775 $(TARGETS) ../binlocal/ + install -m 775 pexorflash ../binlocal/ make -C kernel-module install # ------------ Dependencies -------------------------------------------- pexorflash: pexorflash.o pexorflash.o: pexorflash.c + +.PHONY: kernel-driver +kernel-driver: + make -C kernel-module -- 2.43.0