Line | |
---|
1 | APP_NAME=numsplit |
---|
2 | |
---|
3 | USE+= stdio.o |
---|
4 | USE+= mwmr.o |
---|
5 | USE+= common.o |
---|
6 | |
---|
7 | USES=$(patsubst %,$(BUILD_PATH)%,$(USE)) |
---|
8 | |
---|
9 | OBJS+= consumer.o |
---|
10 | OBJS+= producer.o |
---|
11 | |
---|
12 | SRCS+= consumer.c |
---|
13 | SRCS+= producer.c |
---|
14 | |
---|
15 | all: $(APP_NAME).bin |
---|
16 | |
---|
17 | BIN_NAME_PATH=$(BIN_PATH)$(APP_NAME).bin |
---|
18 | |
---|
19 | $(APP_NAME).bin: main.o $(APP_NAME).ld |
---|
20 | $(LD) -o $(BIN_NAME_PATH) -T $(APP_NAME).ld main.o $(USES) |
---|
21 | $(DU) -D $(BIN_NAME_PATH) > $@.txt |
---|
22 | |
---|
23 | main.o: main.c |
---|
24 | cpp -I. $(INCLUDE) $($*.o_CFLAGS) -o $@.cpp $< |
---|
25 | $(CC) -I. $(INCLUDE) $(CFLAGS) $($*.o_CFLAGS) -c -o $@ $< |
---|
26 | $(DU) -D $@ > $@.txt |
---|
27 | |
---|
28 | main.c: consumer.c producer.c |
---|
29 | #cpp $(INCLUDE) $($*.o_CFLAGS) -o $@.cpp $< |
---|
30 | cat consumer.c producer.c > main.c |
---|
31 | |
---|
32 | %.cpp:%.c |
---|
33 | cpp $(INCLUDE) $($*.o_CFLAGS) -o $@ $< |
---|
34 | |
---|
35 | %.o: %.c |
---|
36 | cpp $(INCLUDE) $($*.o_CFLAGS) -o $@.cpp $< |
---|
37 | $(CC) $(INCLUDE) $(CFLAGS) $($*.o_CFLAGS) -c -o $@ $< |
---|
38 | $(DU) -D $@ > $@.txt |
---|
39 | |
---|
40 | clean: |
---|
41 | rm -f *.o *.bin *.txt core *~ 2>$(TRASH) |
---|
42 | rm $(BIN_NAME_PATH) 2>$(TRASH) |
---|
Note: See
TracBrowser
for help on using the repository browser.