/[projet1]/public/rules.mk
Defence Force logotype

Contents of /public/rules.mk

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1193 - (show annotations)
Thu Sep 18 21:05:12 2014 UTC (5 years, 1 month ago) by Jylam
File size: 1687 byte(s)
Moved rules.mk at the top directory for use in public/oric

1 # OSDK rules.mk for GNU Make
2 # Copyright (c) 2014 Jean-Yves Lamoureux <jylam@lnxscene.org>
3
4
5 # Path of the public/ directory (for instance /home/pennysbird/oric/public/)
6 # OSDKPATH = /home/user/osdkpath
7
8 CPP = cpp
9 CFLAGS += -Wall
10 TOOLS =$(OSDKPATH)/pc/tools/osdk/main/
11 AS =$(TOOLS)/xa/xa
12 CC =$(TOOLS)/compiler/compiler
13 LINKER =$(TOOLS)/link65/link65
14 MSPLIT =$(TOOLS)/macrosplitter/macrosplitter
15 BIN2TXT =$(TOOLS)/bin2txt/bin2txt
16 FILEPACK =$(TOOLS)/filepack/filepack
17 PICTCONV =$(TOOLS)/pictconv/pictconv
18 LINKLIB =$(TOOLS)/Osdk/_final_/lib/
19 OSDKINC =$(TOOLS)/Osdk/_final_/include/
20 MACROS =$(TOOLS)/Osdk/_final_/macro/MACROS.H
21 .PHONY: $(DATA)
22
23 ifndef OSDKPATH
24 $(warning **********************************************)
25 $(warning You must edit this file an fill OSDKPATH ***)
26 $(warning **********************************************)
27 $(error )
28 endif
29
30 RUNBEFOREHACK:=$(shell rm -f $(BIN).final.s)
31
32 %.o: %.s
33 cat $< >> $(BIN).final.s
34 %.o: %.c
35 $(CPP) -traditional-cpp -I$(OSDKINC) $< -o .1$<
36 # Remove C comments
37 $(CPP) -xc++ .1$< -o .2$<
38 # Compile
39 $(CC) -O1 .2$< .3$<
40 # Apply macros
41 cpp -traditional-cpp -include $(MACROS) .3$< -o .1$<.s
42 # Removes #'s
43 grep -v '^#' .1$<.s > .2$<.s
44 # Add \n after each assembly instruction
45 $(MSPLIT) .2$<.s .3$<.s
46 cat .3$<.s >> $(BIN).final.s
47
48 $(BIN): $(DATA) $(OBJ)
49 ifneq ($(NO_LINK),1)
50 $(LINKER) -d $(LINKLIB) $(BIN).final.s -o .$(BIN).linked.s
51 else
52 cp $(BIN).final.s .$(BIN).linked.s
53 endif
54 $(AS) .$(BIN).linked.s -o $@.bin -bt 0x500 -C -W -v -l symbols.txt
55 $(TOOLS)/header/header -a1 $(BIN).bin $(BIN).tap 0x500
56 chmod +x $(BIN).tap
57 clean:
58 rm -f $(BIN) $(DATA) *.tap *.bin symbols.txt .*.c .*.s
59

  ViewVC Help
Powered by ViewVC 1.1.26