summaryrefslogtreecommitdiff
path: root/packages/neuros-pkggen/files/Makefile
blob: fed6835d06a1d31678e3552cb756bdc4704d99fd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# *  Copyright(C) 2007 Neuros Technology International LLC. 
# *               <www.neurostechnology.com>
# *
# *  ubootcmd application make file..............TQ 2007-02-05


# include system config 
include config


# executable name
NT_PACKET     := packet_osd2


# project directories
PACKET_DIR_ROOT   := .

# compiler flags
CFLAGS         += $(DEFINES) -Wall -Werror

# object files
OBJS           := package.o crc32.o

# build all
.PHONY: all
all: $(NT_PACKET)

$(NT_PACKET): $(OBJS)
	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJS)

# install
install: $(NT_PACKET)
	@echo
	@echo "Installing $(NT_PACKET) ... "
	@cp $(NT_PACKET) $(BSP_ROOT)/images/
	@echo

# clean up project
.PHONY: clean

clean:
	@echo
	@rm -f $(NT_PACKET)
	@for dir in  $(PACKET_DIR_ROOT); do \
		echo "Entering $$dir ..."; \
		for file in $$dir/*~ $$dir/*.o $$dir/*.d; do \
			if [ -f $$file ]; then \
				echo "removing $$file"; \
				rm $$file; \
			fi; \
		done; \
	done
	@echo

# include the C include dependencies
-include $(OBJS:.o=.d)


# calculate C inlcude dependencies
%.d: %.c
	@set -e; rm -f $@; \
	$(CC) -MM $(CFLAGS) $< > $@.$$$$; \
	sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' < $@.$$$$ > $@; \
	rm -f $@.$$$$


# include make rules. 
include Makefile.rules