| Line |  | 
|---|
| 1 | # $Id: prog-c.mak,v 1.2 2002-08-20 21:14:30 bird Exp $ | 
|---|
| 2 |  | 
|---|
| 3 | # Testcase for makeing simple C programs. | 
|---|
| 4 |  | 
|---|
| 5 | # root & setup | 
|---|
| 6 | PATH_ROOT=..\.. | 
|---|
| 7 | !include $(PATH_ROOT)\make\setup.mak | 
|---|
| 8 |  | 
|---|
| 9 | # target config. | 
|---|
| 10 | TARGET_NAME = prog-c | 
|---|
| 11 | MAKEFILE    = prog-c.mak | 
|---|
| 12 | TARGET_LIBS = $(LIB_C_OBJ) $(LIB_OS)    # use the static library! | 
|---|
| 13 |  | 
|---|
| 14 | # rules and more | 
|---|
| 15 | RULES_FORWARD = test | 
|---|
| 16 | !include $(MAKE_INCLUDE_PROCESS) | 
|---|
| 17 |  | 
|---|
| 18 | !if !$(BUILD_FORWARDING) | 
|---|
| 19 |  | 
|---|
| 20 |  | 
|---|
| 21 | # some helpers for the output. | 
|---|
| 22 | !if "$(BUILD_MODE)" == "DEBUG" || "$(BUILD_MODE)" == "PROFILE" | 
|---|
| 23 | _STR1 = Hello "C" "DEBUG" World! | 
|---|
| 24 | !else | 
|---|
| 25 | _STR1 = Hello "C" World! | 
|---|
| 26 | !endif | 
|---|
| 27 |  | 
|---|
| 28 | !ifdef ENV_16BIT | 
|---|
| 29 | _STR2 = __16BIT__ | 
|---|
| 30 | !else | 
|---|
| 31 | _STR2 = __32BIT__ | 
|---|
| 32 | !endif | 
|---|
| 33 |  | 
|---|
| 34 |  | 
|---|
| 35 | # | 
|---|
| 36 | # validate that the executable actually runs and produces the desired output. | 
|---|
| 37 | # | 
|---|
| 38 | test: | 
|---|
| 39 | $(TARGET) > out | 
|---|
| 40 | ! ifdef BUILD_VERBOSE | 
|---|
| 41 | type out | 
|---|
| 42 | ! endif | 
|---|
| 43 | $(TOOL_CMP) out << | 
|---|
| 44 | $(_STR1) | 
|---|
| 45 |  | 
|---|
| 46 | $(_STR2) | 
|---|
| 47 |  | 
|---|
| 48 | << | 
|---|
| 49 |  | 
|---|
| 50 | !endif | 
|---|
       
      
  Note:
 See   
TracBrowser
 for help on using the repository browser.